Use keyword arguments in tests

Raisl 5.1 removes support for non-keyword arguments in `#process`,
`#get`, `#post`, `#patch`, `#put`, `#delete`, and `#head` for the
`ActionDispatch::IntegrationTest` and `ActionController::TestCase`
classes. This means we have to add `params` everywhere in the controller
tests.
This commit is contained in:
Ana María Martínez Gómez 2019-05-13 17:42:09 +02:00
parent b8013661a2
commit d1180e2767
No known key found for this signature in database
GPG key ID: EACB9B4BC80C0347
35 changed files with 975 additions and 364 deletions

View file

@ -15,13 +15,13 @@ describe Admin::SchedulesController do
describe 'GET #index' do
it 'renders the index template' do
get :index, conference_id: conference.short_title
get :index, params: { conference_id: conference.short_title }
expect(response).to render_template :index
end
end
describe 'POST #create' do
let(:create_action){ post :create, conference_id: conference.short_title }
let(:create_action){ post :create, params: { conference_id: conference.short_title } }
it 'saves the schedule to the database' do
expect{ create_action }.to change { Schedule.count }.by 1
@ -35,7 +35,7 @@ describe Admin::SchedulesController do
end
describe 'GET #show' do
let(:show_action){ get :show, id: schedule.id, conference_id: conference.short_title }
let(:show_action){ get :show, params: { id: schedule.id, conference_id: conference.short_title } }
it 'assigns the requested schedule to schedule' do
show_action
@ -49,7 +49,7 @@ describe Admin::SchedulesController do
end
describe 'DELETE #destroy' do
let(:destroy_action){ delete :destroy, id: schedule.id, conference_id: conference.short_title }
let(:destroy_action){ delete :destroy, params: { id: schedule.id, conference_id: conference.short_title } }
it 'deletes the schedule' do
expect{ destroy_action }.to change { Schedule.count }.by(-1)