mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
DEV: Upgrade Rails to version 7.1
--------- Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:

committed by
Loïc Guitaut

parent
706e074e6c
commit
ce00f83173
@ -21,11 +21,11 @@ RSpec.describe Auth::DefaultCurrentUserProvider do
|
||||
end
|
||||
|
||||
def get_cookie_info(cookie_jar, name)
|
||||
headers = {}
|
||||
response = ActionDispatch::Response.new
|
||||
cookie_jar.always_write_cookie = true
|
||||
cookie_jar.write(headers)
|
||||
cookie_jar.write(response)
|
||||
|
||||
header = headers["Set-Cookie"]
|
||||
header = response.headers["Set-Cookie"]
|
||||
return if header.nil?
|
||||
|
||||
info = {}
|
||||
|
@ -14,9 +14,9 @@ RSpec.describe Email::MessageBuilder do
|
||||
|
||||
let(:body_modifier_block) { Proc.new { |subject, opts| "modified body" } }
|
||||
let(:visit_link_to_respond_modifier_block) do
|
||||
Proc.new { |subject, opts| "modified visit_link_to_respond" }
|
||||
Proc.new { |subject, opts| "modified_visit_link_to_respond" }
|
||||
end
|
||||
let(:reply_by_email_modifier_block) { Proc.new { |subject, opts| "modified reply_by_email" } }
|
||||
let(:reply_by_email_modifier_block) { Proc.new { |subject, opts| "modified_reply_by_email" } }
|
||||
|
||||
it "has the correct to address" do
|
||||
expect(build_args[:to]).to eq(to_address)
|
||||
@ -69,7 +69,7 @@ RSpec.describe Email::MessageBuilder do
|
||||
include_respond_instructions: true,
|
||||
url: "http://localhost",
|
||||
)
|
||||
expect(builder2.reply_by_email_key).to equal("modified reply_by_email")
|
||||
expect(builder2.reply_by_email_key).to equal("modified_reply_by_email")
|
||||
ensure
|
||||
DiscoursePluginRegistry.unregister_modifier(
|
||||
plugin_instance,
|
||||
@ -93,7 +93,7 @@ RSpec.describe Email::MessageBuilder do
|
||||
url: "http://localhost",
|
||||
)
|
||||
expect(builder2.template_args[:respond_instructions]).to include(
|
||||
"modified visit_link_to_respond",
|
||||
"modified_visit_link_to_respond",
|
||||
)
|
||||
ensure
|
||||
DiscoursePluginRegistry.unregister_modifier(
|
||||
|
@ -14,7 +14,7 @@ RSpec.describe Hijack do
|
||||
self.request = ActionController::TestRequest.new(env, nil, nil)
|
||||
|
||||
# we need this for the 418
|
||||
self.response = ActionDispatch::Response.new
|
||||
set_response!(ActionDispatch::Response.new)
|
||||
end
|
||||
|
||||
def hijack_test(&blk)
|
||||
@ -22,12 +22,10 @@ RSpec.describe Hijack do
|
||||
end
|
||||
end
|
||||
|
||||
let :tester do
|
||||
Hijack::Tester.new
|
||||
end
|
||||
let(:tester) { Hijack::Tester.new }
|
||||
|
||||
describe "Request Tracker integration" do
|
||||
let :logger do
|
||||
let(:logger) do
|
||||
lambda do |env, data|
|
||||
@calls += 1
|
||||
@status = data[:status]
|
||||
@ -181,7 +179,7 @@ RSpec.describe Hijack do
|
||||
end
|
||||
|
||||
result =
|
||||
"HTTP/1.1 302 Found\r\nLocation: http://awesome.com\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: 84\r\nConnection: close\r\nX-Runtime: 1.000000\r\n\r\n<html><body>You are being <a href=\"http://awesome.com\">redirected</a>.</body></html>"
|
||||
"HTTP/1.1 302 Found\r\nLocation: http://awesome.com\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: 0\r\nConnection: close\r\nX-Runtime: 1.000000\r\n\r\n"
|
||||
expect(tester.io.string).to eq(result)
|
||||
end
|
||||
|
||||
|
@ -9,11 +9,12 @@ RSpec.describe Migration::SafeMigrate do
|
||||
end
|
||||
|
||||
def migrate_up(path)
|
||||
migrations = ActiveRecord::MigrationContext.new(path, ActiveRecord::SchemaMigration).migrations
|
||||
migrations = ActiveRecord::MigrationContext.new(path).migrations
|
||||
ActiveRecord::Migrator.new(
|
||||
:up,
|
||||
migrations,
|
||||
ActiveRecord::SchemaMigration,
|
||||
ActiveRecord::Base.connection.schema_migration,
|
||||
ActiveRecord::Base.connection.internal_metadata,
|
||||
migrations.first.version,
|
||||
).run
|
||||
end
|
||||
@ -77,7 +78,7 @@ RSpec.describe Migration::SafeMigrate do
|
||||
|
||||
output = capture_stdout { migrate_up(path) }
|
||||
|
||||
expect(output).to include("change_column_null(:users, :username, true)")
|
||||
expect(output).to include("change_column_null(:users, :username, true, nil)")
|
||||
end
|
||||
|
||||
it "supports being disabled" do
|
||||
|
@ -422,9 +422,7 @@ RSpec.describe SiteSettingExtension do
|
||||
end
|
||||
end
|
||||
|
||||
let :test_enum_class do
|
||||
TestEnumClass
|
||||
end
|
||||
let(:test_enum_class) { TestEnumClass }
|
||||
|
||||
before do
|
||||
settings.setting(:test_enum, "en", enum: test_enum_class)
|
||||
|
Reference in New Issue
Block a user