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

@ -13,7 +13,7 @@ class NotesControllerTest < ActionController::TestCase
project = users(:admin_user).projects.first
count = users(:admin_user).notes.count
post :create, note: {body: "test note", project_id: project.id}, format: :js
post :create, params: { note: {body: "test note", project_id: project.id}, format: :js }
assert_response 200
assert assigns['saved'], "@saved should be true"
@ -26,7 +26,7 @@ class NotesControllerTest < ActionController::TestCase
note = users(:admin_user).notes.first
refute_equal "test", note.body
post :update, id: note.id, note: {body: "test"}, format: :js
post :update, params: { id: note.id, note: {body: "test"}, format: :js }
assert_equal "test", note.reload.body
end
@ -36,7 +36,7 @@ class NotesControllerTest < ActionController::TestCase
note = users(:admin_user).notes.first
count = users(:admin_user).notes.count
post :destroy, id: note.id, format: :js
post :destroy, params: { id: note.id, format: :js }
old_note = users(:admin_user).notes.where(id: note.id).first
assert_nil old_note