Use be_successful instead of be_success

Rails 5.2 warns:

> The `success?` predicate is deprecated and will be removed in Rails 6.0.
> Please use `successful?` as provided by Rack::Response::Helpers.

RSpec correspondingly provides `be_successful`.
This commit is contained in:
Andrew Kvalheim 2022-01-23 14:06:02 -08:00
parent 3bbbdb4aae
commit e30880229c
9 changed files with 17 additions and 17 deletions

View file

@ -242,7 +242,7 @@ describe Admin::ConferencesController do
it 're-renders the new template' do it 're-renders the new template' do
post :create, params: { conference: post :create, params: { conference:
attributes_for(:conference, short_title: nil, organization_id: organization.id) } attributes_for(:conference, short_title: nil, organization_id: organization.id) }
expect(response).to be_success expect(response).to be_successful
end end
end end
@ -259,7 +259,7 @@ describe Admin::ConferencesController do
it 're-renders the new template' do it 're-renders the new template' do
conference conference
post :create, params: { conference: attributes_for(:conference, short_title: conference.short_title, organization_id: organization.id) } post :create, params: { conference: attributes_for(:conference, short_title: conference.short_title, organization_id: organization.id) }
expect(response).to be_success expect(response).to be_successful
end end
end end
end end

View file

@ -33,7 +33,7 @@ describe Admin::EventSchedulesController do
it 'has 200 status code' do it 'has 200 status code' do
create_action create_action
expect(response).to be_success expect(response).to be_successful
end end
end end
@ -80,7 +80,7 @@ describe Admin::EventSchedulesController do
end end
it 'has 200 status code' do it 'has 200 status code' do
expect(response).to be_success expect(response).to be_successful
end end
end end
@ -115,7 +115,7 @@ describe Admin::EventSchedulesController do
it 'has 200 status code' do it 'has 200 status code' do
destroy_action destroy_action
expect(response).to be_success expect(response).to be_successful
end end
end end
end end

View file

@ -104,7 +104,7 @@ describe Admin::RegistrationPeriodsController do
start_date: nil, start_date: nil,
end_date: nil) end_date: nil)
} }
expect(response).to be_success expect(response).to be_successful
end end
end end
end end

View file

@ -13,7 +13,7 @@ describe Api::V1::ConferencesController do
end end
it 'returns successful response' do it 'returns successful response' do
expect(response).to be_success expect(response).to be_successful
end end
it 'returns all conferences' do it 'returns all conferences' do
@ -32,7 +32,7 @@ describe Api::V1::ConferencesController do
end end
it 'returns successful response' do it 'returns successful response' do
expect(response).to be_success expect(response).to be_successful
end end
it 'returns only one conference' do it 'returns only one conference' do

View file

@ -13,7 +13,7 @@ describe Api::V1::EventsController do
get :index, params: { format: :json } get :index, params: { format: :json }
json = JSON.parse(response.body)['events'] json = JSON.parse(response.body)['events']
expect(response).to be_success expect(response).to be_successful
expect(json.pluck('title')).to contain_exactly('Conference Event', 'Example Event') expect(json.pluck('title')).to contain_exactly('Conference Event', 'Example Event')
end end
@ -25,7 +25,7 @@ describe Api::V1::EventsController do
get :index, params: { conference_id: conference.short_title, format: :json } get :index, params: { conference_id: conference.short_title, format: :json }
json = JSON.parse(response.body)['events'] json = JSON.parse(response.body)['events']
expect(response).to be_success expect(response).to be_successful
expect(json.length).to eq(1) expect(json.length).to eq(1)
expect(json[0]['title']).to eq('Conference Event') expect(json[0]['title']).to eq('Conference Event')

View file

@ -15,7 +15,7 @@ describe Api::V1::RoomsController do
get :index, params: { format: :json } get :index, params: { format: :json }
json = JSON.parse(response.body)['rooms'] json = JSON.parse(response.body)['rooms']
expect(response).to be_success expect(response).to be_successful
expect(json.pluck('name')).to contain_exactly('Conference Room', 'Test Room') expect(json.pluck('name')).to contain_exactly('Conference Room', 'Test Room')
end end
@ -27,7 +27,7 @@ describe Api::V1::RoomsController do
get :index, params: { conference_id: conference.short_title, format: :json } get :index, params: { conference_id: conference.short_title, format: :json }
json = JSON.parse(response.body)['rooms'] json = JSON.parse(response.body)['rooms']
expect(response).to be_success expect(response).to be_successful
expect(json.length).to eq(1) expect(json.length).to eq(1)
expect(json[0]['name']).to eq('Conference Room') expect(json[0]['name']).to eq('Conference Room')

View file

@ -21,7 +21,7 @@ describe Api::V1::SpeakersController do
get :index, params: { format: :json } get :index, params: { format: :json }
json = JSON.parse(response.body)['speakers'] json = JSON.parse(response.body)['speakers']
expect(response).to be_success expect(response).to be_successful
expect(json.pluck('name')).to contain_exactly('Conf_Speaker', 'Speaker') expect(json.pluck('name')).to contain_exactly('Conf_Speaker', 'Speaker')
end end
end end
@ -32,7 +32,7 @@ describe Api::V1::SpeakersController do
get :index, params: { conference_id: conference.short_title, format: :json } get :index, params: { conference_id: conference.short_title, format: :json }
json = JSON.parse(response.body)['speakers'] json = JSON.parse(response.body)['speakers']
expect(response).to be_success expect(response).to be_successful
expect(json.length).to eq(1) expect(json.length).to eq(1)
expect(json[0]['name']).to eq('Conf_Speaker') expect(json[0]['name']).to eq('Conf_Speaker')

View file

@ -14,7 +14,7 @@ describe Api::V1::TracksController do
get :index, params: { format: :json } get :index, params: { format: :json }
json = JSON.parse(response.body)['tracks'] json = JSON.parse(response.body)['tracks']
expect(response).to be_success expect(response).to be_successful
expect(json.pluck('name')).to contain_exactly('Conference Track', 'Test Track') expect(json.pluck('name')).to contain_exactly('Conference Track', 'Test Track')
end end
@ -26,7 +26,7 @@ describe Api::V1::TracksController do
get :index, params: { conference_id: conference.short_title, format: :json } get :index, params: { conference_id: conference.short_title, format: :json }
json = JSON.parse(response.body)['tracks'] json = JSON.parse(response.body)['tracks']
expect(response).to be_success expect(response).to be_successful
expect(json.length).to eq(1) expect(json.length).to eq(1)
expect(json[0]['name']).to eq('Conference Track') expect(json[0]['name']).to eq('Conference Track')

View file

@ -23,7 +23,7 @@ describe SchedulesController do
end end
it 'has 200 status code' do it 'has 200 status code' do
expect(response).to be_success expect(response).to be_successful
end end
end end
end end