aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/log_subscriber_test.rb
diff options
context:
space:
mode:
authorKir Shatrov <shatrov@me.com>2015-01-04 10:35:06 +0100
committerKir Shatrov <shatrov@me.com>2015-01-29 14:44:46 +0200
commitbaf14ae513337cb185acf865e93dfc48f3aabf6a (patch)
tree77235d82964272c8721a62ae046b16279d01f945 /actionpack/test/controller/log_subscriber_test.rb
parent069b72aaf04d2caef76f8e71f320716129f2d949 (diff)
downloadrails-baf14ae513337cb185acf865e93dfc48f3aabf6a.tar.gz
rails-baf14ae513337cb185acf865e93dfc48f3aabf6a.tar.bz2
rails-baf14ae513337cb185acf865e93dfc48f3aabf6a.zip
Switch to kwargs in ActionController::TestCase and ActionDispatch::Integration
Non-kwargs requests are deprecated now. Guides are updated as well. `post url, nil, nil, { a: 'b' }` doesn't make sense. `post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
Diffstat (limited to 'actionpack/test/controller/log_subscriber_test.rb')
-rw-r--r--actionpack/test/controller/log_subscriber_test.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb
index 864c6ee130..03a4ad7823 100644
--- a/actionpack/test/controller/log_subscriber_test.rb
+++ b/actionpack/test/controller/log_subscriber_test.rb
@@ -140,7 +140,7 @@ class ACLogSubscriberTest < ActionController::TestCase
end
def test_process_action_with_parameters
- get :show, :id => '10'
+ get :show, params: { id: '10' }
wait
assert_equal 3, logs.size
@@ -148,8 +148,8 @@ class ACLogSubscriberTest < ActionController::TestCase
end
def test_multiple_process_with_parameters
- get :show, :id => '10'
- get :show, :id => '20'
+ get :show, params: { id: '10' }
+ get :show, params: { id: '20' }
wait
@@ -160,7 +160,7 @@ class ACLogSubscriberTest < ActionController::TestCase
def test_process_action_with_wrapped_parameters
@request.env['CONTENT_TYPE'] = 'application/json'
- post :show, :id => '10', :name => 'jose'
+ post :show, params: { id: '10', name: 'jose' }
wait
assert_equal 3, logs.size
@@ -186,7 +186,9 @@ class ACLogSubscriberTest < ActionController::TestCase
def test_process_action_with_filter_parameters
@request.env["action_dispatch.parameter_filter"] = [:lifo, :amount]
- get :show, :lifo => 'Pratik', :amount => '420', :step => '1'
+ get :show, params: {
+ lifo: 'Pratik', amount: '420', step: '1'
+ }
wait
params = logs[1]