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,11 +1,13 @@
# frozen_string_literal: true
require 'spec_helper'
describe Admin::EventSchedulesController do
let(:venue) { create(:venue) }
let(:conference) { create(:conference, venue: venue) }
let(:room) { create(:room, venue: venue) }
let(:schedule) { create(:schedule, program: conference.program)}
let(:event_schedule) { create(:event_schedule, schedule: schedule)}
let(:schedule) { create(:schedule, program: conference.program) }
let(:event_schedule) { create(:event_schedule, schedule: schedule) }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
let(:organizer) { create(:user, role_ids: organizer_role.id) }
@ -18,16 +20,16 @@ describe Admin::EventSchedulesController do
describe 'POST #create' do
context 'with valid attributes' do
let(:create_action) do
post :create, conference_id: conference.short_title, event_schedule:
post :create, params: { conference_id: conference.short_title, event_schedule:
attributes_for(:event_schedule,
schedule_id: schedule.id,
event_id: create(:event, program: conference.program).id,
room_id: create(:room, venue: venue).id,
start_time: conference.start_date + conference.start_hour.hours)
start_time: conference.start_date + conference.start_hour.hours) }
end
it 'saves the event schedule to the database' do
expect{ create_action }.to change { EventSchedule.count }.by 1
expect { create_action }.to change { EventSchedule.count }.by 1
end
it 'has 200 status code' do
@ -37,18 +39,17 @@ describe Admin::EventSchedulesController do
end
context 'with invalid attributes' do
let(:create_action) do
post :create, conference_id: conference.short_title, event_schedule:
post :create, params: { conference_id: conference.short_title, event_schedule:
attributes_for(:event_schedule,
schedule_id: schedule.id,
event_id: nil,
room_id: nil,
start_time: nil)
start_time: nil) }
end
it 'does not save the event schedule to the database' do
expect{ create_action }.to_not change { EventSchedule.count }
expect { create_action }.to_not change { EventSchedule.count }
end
it 'has 422 status code' do
@ -61,12 +62,12 @@ describe Admin::EventSchedulesController do
describe 'POST #update' do
context 'with valid attributes' do
before :each do
patch :update, id: event_schedule.id, conference_id: conference.short_title, event_schedule:
patch :update, params: { id: event_schedule.id, conference_id: conference.short_title, event_schedule:
attributes_for(:event_schedule,
schedule_id: schedule.id,
event_id: create(:event, program: conference.program).id,
room_id: room.id,
start_time: conference.start_date + conference.start_hour.hours)
start_time: conference.start_date + conference.start_hour.hours) }
event_schedule.reload
end
@ -85,15 +86,15 @@ describe Admin::EventSchedulesController do
context 'with invalid attributes' do
let(:update_action) do
patch :update, id: event_schedule.id, conference_id: conference.short_title, event_schedule:
patch :update, params: { id: event_schedule.id, conference_id: conference.short_title, event_schedule:
attributes_for(:event_schedule,
schedule_id: schedule.id,
event_id: nil,
room_id: nil,
start_time: nil)
start_time: nil) }
end
it 'does not save the event schedule to the database' do
expect{ update_action }.to_not change { event_schedule }
expect { update_action }.to_not change { event_schedule }
end
it 'has 422 status code' do
@ -105,11 +106,11 @@ describe Admin::EventSchedulesController do
describe 'DELETE #destroy' do
let(:destroy_action) do
delete :destroy, id: event_schedule.id, conference_id: conference.short_title
delete :destroy, params: { id: event_schedule.id, conference_id: conference.short_title }
end
it 'deletes the event schedule' do
expect{ destroy_action }.to change { EventSchedule.count }.by(-1)
expect { destroy_action }.to change { EventSchedule.count }.by(-1)
end
it 'has 200 status code' do