mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
Use the keyword args syntax for controller actions
Co-Authored-By: Dan Rice <dnrce@users.noreply.github.com>
This commit is contained in:
parent
755a7a1b80
commit
2f85a42f91
19 changed files with 258 additions and 241 deletions
|
|
@ -4,9 +4,9 @@ class RecurringTodosTest < ActionDispatch::IntegrationTest
|
|||
|
||||
def logs_in_as(user,plain_pass)
|
||||
@user = user
|
||||
post "/login", :user_login => @user.login,
|
||||
post "/login", params: { :user_login => @user.login,
|
||||
:user_password => plain_pass,
|
||||
:user_noexpiry => 'n'
|
||||
:user_noexpiry => 'n' }
|
||||
assert_response :redirect
|
||||
follow_redirect!
|
||||
assert_response :success
|
||||
|
|
@ -22,7 +22,7 @@ class RecurringTodosTest < ActionDispatch::IntegrationTest
|
|||
|
||||
# when I toggle the todo complete
|
||||
todo = Todo.where(:recurring_todo_id => 1).first
|
||||
put "/todos/#{todo.id}/toggle_check", :_source_view => 'todo'
|
||||
put "/todos/#{todo.id}/toggle_check", params: { :_source_view => 'todo' }
|
||||
todo.reload
|
||||
assert todo.completed?
|
||||
|
||||
|
|
@ -32,7 +32,8 @@ class RecurringTodosTest < ActionDispatch::IntegrationTest
|
|||
refute_equal todo2.id, todo.id # and the todos should be different
|
||||
|
||||
# when I delete the recurring todo
|
||||
delete_via_redirect "/recurring_todos/#{rt.id}", :_source_view => 'todo'
|
||||
delete "/recurring_todos/#{rt.id}", params: { :_source_view => 'todo' }
|
||||
follow_redirect!
|
||||
|
||||
todo.reload
|
||||
todo2.reload
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ class StoriesTest < ActionDispatch::IntegrationTest
|
|||
get "/signup"
|
||||
assert_response :success
|
||||
assert_template "users/new"
|
||||
post "/users", :user => {:login => "newbie",
|
||||
:password => "newbiepass",
|
||||
:password_confirmation => "newbiepass"}
|
||||
post "/users", params: { :user => {:login => "newbie",
|
||||
:password => "newbiepass",
|
||||
:password_confirmation => "newbiepass"} }
|
||||
assert_response :redirect
|
||||
follow_redirect!
|
||||
assert_response :success
|
||||
|
|
@ -47,9 +47,9 @@ class StoriesTest < ActionDispatch::IntegrationTest
|
|||
|
||||
def logs_in_as(user,plain_pass)
|
||||
@user = user
|
||||
post "/login", :user_login => @user.login,
|
||||
:user_password => plain_pass,
|
||||
:user_noexpiry => 'n'
|
||||
post "/login", params: { :user_login => @user.login,
|
||||
:user_password => plain_pass,
|
||||
:user_noexpiry => 'n' }
|
||||
assert_response :redirect
|
||||
follow_redirect!
|
||||
assert_response :success
|
||||
|
|
@ -75,7 +75,7 @@ class StoriesTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
def signs_up_with(options)
|
||||
post "/users", options
|
||||
post "/users", params: options
|
||||
assert_response :redirect
|
||||
follow_redirect!
|
||||
assert_response :success
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ class TodoXmlApiTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
def test_get_tickler_needs_authentication
|
||||
get '/tickler.xml', {}, {}
|
||||
get '/tickler.xml', params: {}, headers: {}
|
||||
assert_response 401
|
||||
|
||||
get "/tickler.xml", {}, {'HTTP_AUTHORIZATION' => "Basic " + Base64.encode64("wrong:wrong"),'ACCEPT' => 'application/xml'}
|
||||
get "/tickler.xml", params: {}, headers: {'HTTP_AUTHORIZATION' => "Basic " + Base64.encode64("wrong:wrong"),'ACCEPT' => 'application/xml'}
|
||||
assert_response 401
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class UsersXmlApiTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
def test_get_users_as_xml
|
||||
get '/users.xml', {}, basic_auth_headers()
|
||||
get '/users.xml', params: {}, headers: basic_auth_headers()
|
||||
assert_response :success
|
||||
assert_select 'users' do
|
||||
assert_select 'user', count: 4
|
||||
|
|
@ -76,7 +76,7 @@ class UsersXmlApiTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
def test_get_user_as_xml
|
||||
get "/users/#{users(:other_user).id}.xml", {}, basic_auth_headers()
|
||||
get "/users/#{users(:other_user).id}.xml", params: {}, headers: basic_auth_headers()
|
||||
assert_response :success
|
||||
assert_select 'user'
|
||||
assert_select 'password', false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue