Use the keyword args syntax for controller actions

Co-Authored-By: Dan Rice <dnrce@users.noreply.github.com>
This commit is contained in:
Matt Rogers 2018-11-03 11:00:27 -05:00
parent 755a7a1b80
commit 2f85a42f91
No known key found for this signature in database
GPG key ID: 605D017C07EB4316
19 changed files with 258 additions and 241 deletions

View file

@ -69,7 +69,7 @@ class ActionController::TestCase
end
def ajax_create(name)
xhr :post, :create, get_model_class.downcase => {:name => name}
post :create, xhr: true, params: { get_model_class.downcase => {:name => name} }
end
def assert_number_of_items_in_rss_feed(expected)
@ -110,7 +110,7 @@ end
class ActionDispatch::IntegrationTest
def authenticated_post_xml(url, username, password, parameters, headers = {})
post url, parameters,
post url, params: parameters, headers:
{ 'HTTP_AUTHORIZATION' => "Basic " + Base64.encode64("#{username}:#{password}"),
'ACCEPT' => 'application/xml',
'CONTENT_TYPE' => 'application/xml'
@ -118,7 +118,7 @@ class ActionDispatch::IntegrationTest
end
def authenticated_get_xml(url, username, password, parameters, headers = {})
get url, parameters,
get url, params: parameters, headers:
{ 'HTTP_AUTHORIZATION' => "Basic " + Base64.encode64("#{username}:#{password}"),
'ACCEPT' => 'application/xml',
'CONTENT_TYPE' => 'application/xml'