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,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe ConferenceRegistrationsController, type: :controller do
@ -11,7 +13,7 @@ describe ConferenceRegistrationsController, type: :controller do
before :each do
sign_in send(user) if user
stub_const('ENV', ENV.to_hash.merge('OSEM_ICHAIN_ENABLED' => ichain))
get :new, conference_id: conference.short_title
get :new, params: { conference_id: conference.short_title }
end
it 'redirects' do
@ -27,7 +29,7 @@ describe ConferenceRegistrationsController, type: :controller do
before :each do
sign_in send(user) if user
stub_const('ENV', ENV.to_hash.merge('OSEM_ICHAIN_ENABLED' => ichain))
get :new, conference_id: conference.short_title
get :new, params: { conference_id: conference.short_title }
end
it 'user variable exists' do
@ -229,7 +231,7 @@ describe ConferenceRegistrationsController, type: :controller do
context 'successful request' do
before do
get :show, conference_id: conference.short_title
get :show, params: { conference_id: conference.short_title }
end
it 'assigns variables' do
@ -248,7 +250,7 @@ describe ConferenceRegistrationsController, type: :controller do
@purchased_ticket = create(:ticket_purchase, conference: conference,
user: user,
ticket: @ticket)
get :show, conference_id: conference.short_title
get :show, params: { conference_id: conference.short_title }
end
it 'does not assign price of purchased tickets to total_price and purchased tickets to tickets without payment' do
@ -258,7 +260,7 @@ describe ConferenceRegistrationsController, type: :controller do
context 'user has not purchased any ticket' do
before do
get :show, conference_id: conference.short_title
get :show, params: { conference_id: conference.short_title }
end
it 'assigns 0 dollars to total_price and empty array to tickets variables' do
@ -271,7 +273,7 @@ describe ConferenceRegistrationsController, type: :controller do
describe 'GET #edit' do
before do
@registration = create(:registration, conference: conference, user: user)
get :edit, conference_id: conference.short_title
get :edit, params: { conference_id: conference.short_title }
end
it 'assigns conference and registration variable' do
@ -289,13 +291,12 @@ describe ConferenceRegistrationsController, type: :controller do
@registration = create(:registration,
conference: conference,
user: user,
arrival: Date.new(2014, 04, 25))
arrival: Date.new(2014, 0o4, 25))
end
context 'updates successfully' do
before do
patch :update, registration: attributes_for(:registration, arrival: Date.new(2014, 04, 29)),
conference_id: conference.short_title
patch :update, params: { registration: attributes_for(:registration, arrival: Date.new(2014, 0o4, 29)), conference_id: conference.short_title }
end
it 'redirects to registration show path' do
@ -308,15 +309,14 @@ describe ConferenceRegistrationsController, type: :controller do
it 'updates the registration' do
@registration.reload
expect(@registration.arrival).to eq Date.new(2014, 04, 29)
expect(@registration.arrival).to eq Date.new(2014, 0o4, 29)
end
end
context 'update fails' do
before do
allow_any_instance_of(Registration).to receive(:update_attributes).and_return(false)
patch :update, registration: attributes_for(:registration, arrival: Date.new(2014, 04, 27)),
conference_id: conference.short_title
patch :update, params: { registration: attributes_for(:registration, arrival: Date.new(2014, 0o4, 27)), conference_id: conference.short_title }
end
it 'renders edit template' do
@ -329,7 +329,7 @@ describe ConferenceRegistrationsController, type: :controller do
it 'does not update the registration' do
@registration.reload
expect(@registration.arrival).to eq Date.new(2014, 04, 25)
expect(@registration.arrival).to eq Date.new(2014, 0o4, 25)
end
end
end
@ -341,7 +341,7 @@ describe ConferenceRegistrationsController, type: :controller do
context 'deletes successfully' do
before(:each, run: true) do
delete :destroy, conference_id: conference.short_title
delete :destroy, params: { conference_id: conference.short_title }
end
it 'redirects to root path', run: true do
@ -354,15 +354,15 @@ describe ConferenceRegistrationsController, type: :controller do
it 'deletes the registration' do
expect do
delete :destroy, conference_id: conference.short_title
end.to change{ Registration.count }.from(2).to(1)
delete :destroy, params: { conference_id: conference.short_title }
end.to change { Registration.count }.from(2).to(1)
end
end
context 'delete fails' do
before do
allow_any_instance_of(Registration).to receive(:destroy).and_return(false)
delete :destroy, conference_id: conference.short_title
delete :destroy, params: { conference_id: conference.short_title }
end
it 'redirects to registration show path' do