Rebuild rubocop TODOs after auto-correcting

This commit is contained in:
James Mason 2018-04-04 10:18:51 -07:00
parent 31c50255e9
commit 84dbb52d11
No known key found for this signature in database
GPG key ID: 1B3951886C449023
580 changed files with 3689 additions and 3133 deletions

View file

@ -1,24 +1,24 @@
# frozen_string_literal: true
require 'spec_helper'
describe Admin::BoothsController do
let(:admin) { create(:admin) }
let(:conference) { create(:conference) }
let(:booth) { create(:booth, title: 'Title', conference: conference) }
let(:admin) { create(:admin) }
context 'not logged in user' do
describe 'GET index' do
it 'does not render admin/booths#index' do
get :index, conference_id: conference.short_title
get :index, params: { conference_id: conference.short_title }
expect(response).to redirect_to(user_session_path)
end
end
describe 'GET show' do
it 'does not render admin/booths#show' do
get :show, id: booth.id, conference_id: conference.short_title
get :show, params: { id: booth.id, conference_id: conference.short_title }
expect(response).to redirect_to(user_session_path)
end
end
@ -30,7 +30,7 @@ describe Admin::BoothsController do
end
describe 'GET index' do
before { get :index, conference_id: conference.short_title }
before { get :index, params: { conference_id: conference.short_title } }
it 'assigns attributes for booths' do
expect(assigns(:booths)).to eq([booth])
@ -42,7 +42,7 @@ describe Admin::BoothsController do
end
describe 'GET new' do
before { get :new, conference_id: conference.short_title }
before { get :new, params: { conference_id: conference.short_title } }
it 'assigns attributes for booths' do
expect(assigns(:booth)).to be_a_new(Booth)
@ -55,11 +55,11 @@ describe Admin::BoothsController do
describe 'POST #create' do
context 'successfully created' do
before { post :create, booth: attributes_for(:booth), conference_id: conference.short_title }
before { post :create, params: { booth: attributes_for(:booth), conference_id: conference.short_title } }
it 'creates a new booth' do
expected = expect do
post :create, booth: attributes_for(:booth), conference_id: conference.short_title
post :create, params: { booth: attributes_for(:booth), conference_id: conference.short_title }
end
expected.to change { Booth.count }.by(1)
end
@ -78,11 +78,11 @@ describe Admin::BoothsController do
end
context 'create action fails' do
before { post :create, booth: attributes_for(:booth, title: ''), conference_id: conference.short_title }
before { post :create, params: { booth: attributes_for(:booth, title: ''), conference_id: conference.short_title } }
it 'does not create any record' do
expected = expect do
post :create, booth: attributes_for(:booth, title: ''), conference_id: conference.short_title
post :create, params: { booth: attributes_for(:booth, title: ''), conference_id: conference.short_title }
end
expected.to_not change(Booth, :count)
end
@ -98,7 +98,7 @@ describe Admin::BoothsController do
end
describe 'GET #edit' do
before { get :edit, id: booth.id, conference_id: conference.short_title }
before { get :edit, params: { id: booth.id, conference_id: conference.short_title } }
it 'renders edit template' do
expect(response).to render_template('edit')
@ -111,7 +111,7 @@ describe Admin::BoothsController do
describe 'PATCH #update' do
context 'updates suchessfully' do
before { patch :update, id: booth.id, booth: attributes_for(:booth, title: 'different'), conference_id: conference.short_title }
before { patch :update, params: { id: booth.id, booth: attributes_for(:booth, title: 'different'), conference_id: conference.short_title } }
it 'redirects to admin booth index path' do
expect(response).to redirect_to admin_conference_booths_path
end