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:
parent
b8013661a2
commit
d1180e2767
35 changed files with 975 additions and 364 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue