diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-10-09 02:48:01 -0700 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-10-09 02:48:01 -0700 |
commit | 29e704d98bec8783d45f58b639972973f18be016 (patch) | |
tree | b04da83592b9b86e225a6a36e2bedcd6d7932cf3 /actionpack/test | |
parent | 09b3b76f77aa6c033566eb4abd011b41604aeacc (diff) | |
parent | 8642c2aadc94b6763290711384c265289b02faaa (diff) | |
download | rails-29e704d98bec8783d45f58b639972973f18be016.tar.gz rails-29e704d98bec8783d45f58b639972973f18be016.tar.bz2 rails-29e704d98bec8783d45f58b639972973f18be016.zip |
Merge pull request #12083 from BlueHotDog/fixing_respond_with
Fixing repond_with working directly on the options hash
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/mime/respond_with_test.rb | 15 | ||||
-rw-r--r-- | actionpack/test/fixtures/respond_with/respond_with_additional_params.html.erb | 0 |
2 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/controller/mime/respond_with_test.rb b/actionpack/test/controller/mime/respond_with_test.rb index 76af9e3414..a70592fa1b 100644 --- a/actionpack/test/controller/mime/respond_with_test.rb +++ b/actionpack/test/controller/mime/respond_with_test.rb @@ -65,7 +65,17 @@ class RespondWithController < ActionController::Base respond_with(resource, :responder => responder) end + def respond_with_additional_params + @params = RespondWithController.params + respond_with({:result => resource}, @params) + end + protected + def self.params + { + :foo => 'bar' + } + end def resource Customer.new("david", request.delete? ? nil : 13) @@ -145,6 +155,11 @@ class RespondWithControllerTest < ActionController::TestCase Mime::Type.unregister(:mobile) end + def test_respond_with_shouldnt_modify_original_hash + get :respond_with_additional_params + assert_equal RespondWithController.params, assigns(:params) + end + def test_using_resource @request.accept = "application/xml" get :using_resource diff --git a/actionpack/test/fixtures/respond_with/respond_with_additional_params.html.erb b/actionpack/test/fixtures/respond_with/respond_with_additional_params.html.erb new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/actionpack/test/fixtures/respond_with/respond_with_additional_params.html.erb |