aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRichard Schneeman <richard.schneeman@gmail.com>2015-11-06 16:32:51 -0600
committerRichard Schneeman <richard.schneeman@gmail.com>2015-11-06 16:32:51 -0600
commit92bc8cdb0771bf6ffcfb31ef58dba529527b514c (patch)
treedbef2dfcf006ecadf748de995c23dba857ac9d33 /activerecord/test
parent79d310fbd33c172f7f54d989191008581e028b64 (diff)
parent2fe4586974689842dbdf3354678438618089accc (diff)
downloadrails-92bc8cdb0771bf6ffcfb31ef58dba529527b514c.tar.gz
rails-92bc8cdb0771bf6ffcfb31ef58dba529527b514c.tar.bz2
rails-92bc8cdb0771bf6ffcfb31ef58dba529527b514c.zip
Merge pull request #21967 from kevinbuch/connection-middleware-mutation
Avoid mutating original response in connection management middleware
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/connection_management_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_management_test.rb b/activerecord/test/cases/connection_management_test.rb
index dff6ea0fb0..cf8c4c688a 100644
--- a/activerecord/test/cases/connection_management_test.rb
+++ b/activerecord/test/cases/connection_management_test.rb
@@ -94,6 +94,13 @@ module ActiveRecord
assert response_body.respond_to?(:to_path)
assert_equal response_body.to_path, "/path"
end
+
+ test "doesn't mutate the original response" do
+ original_response = [200, {}, 'hi']
+ app = lambda { |_| original_response }
+ response_body = ConnectionManagement.new(app).call(@env)[2]
+ assert_equal original_response.last, 'hi'
+ end
end
end
end