mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: displaying wrong avatar and letter avatar
correct regression where params and env is reused in production
This commit is contained in:
@ -8,8 +8,10 @@ describe Hijack do
|
||||
|
||||
def initialize
|
||||
@io = StringIO.new
|
||||
self.request = ActionController::TestRequest.new(
|
||||
{ "rack.hijack" => lambda { @io } },
|
||||
self.request = ActionController::TestRequest.new({
|
||||
"rack.hijack" => lambda { @io },
|
||||
"rack.input" => StringIO.new
|
||||
},
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
@ -27,6 +29,18 @@ describe Hijack do
|
||||
Hijack::Tester.new
|
||||
end
|
||||
|
||||
it "dupes the request params and env" do
|
||||
orig_req = tester.request
|
||||
copy_req = nil
|
||||
|
||||
tester.hijack_test do
|
||||
copy_req = request
|
||||
render body: "hello world", status: 200
|
||||
end
|
||||
|
||||
expect(copy_req.object_id).not_to eq(orig_req.object_id)
|
||||
end
|
||||
|
||||
it "handles expires_in" do
|
||||
tester.hijack_test do
|
||||
expires_in 1.year
|
||||
|
Reference in New Issue
Block a user