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 ApplicationHelper, type: :helper do
@ -27,7 +29,7 @@ describe ApplicationHelper, type: :helper do
before :each do
@other_event = create(:event, program: conference.program, state: 'confirmed')
schedule = create(:schedule, program: conference.program)
conference.program.update_attributes!(selected_schedule: schedule)
conference.program.update!(selected_schedule: schedule)
@event_schedule = create(:event_schedule, event: event, start_time: conference.start_date + conference.start_hour.hours, room: create(:room), schedule: schedule)
@other_event_schedule = create(:event_schedule, event: @other_event, start_time: conference.start_date + conference.start_hour.hours, room: create(:room), schedule: schedule)
end
@ -38,7 +40,7 @@ describe ApplicationHelper, type: :helper do
end
it 'when event is in between the other event' do
@event_schedule.update_attributes!(start_time: @other_event_schedule.start_time + 10.minutes)
@event_schedule.update!(start_time: @other_event_schedule.start_time + 10.minutes)
expect(concurrent_events(event).include?(@other_event)).to eq true
end
end
@ -50,12 +52,12 @@ describe ApplicationHelper, type: :helper do
end
it 'when one event starts and other ends at the same time' do
@event_schedule.update_attributes!(start_time: @other_event_schedule.end_time)
@event_schedule.update!(start_time: @other_event_schedule.end_time)
expect(concurrent_events(event).present?).to eq false
end
it 'when conference program does not have a selected schedule' do
conference.program.update_attributes!(selected_schedule_id: nil)
conference.program.update!(selected_schedule_id: nil)
expect(concurrent_events(event).present?).to eq false
end
end
@ -81,7 +83,7 @@ describe ApplicationHelper, type: :helper do
context 'first sponsorship_level' do
before do
first_sponsorship_level = create(:sponsorship_level, position: 1)
sponsor.update_attributes(sponsorship_level: first_sponsorship_level)
sponsor.update(sponsorship_level: first_sponsorship_level)
end
it 'returns correct url' do
@ -92,7 +94,7 @@ describe ApplicationHelper, type: :helper do
context 'second sponsorship_level' do
before do
second_sponsorship_level = create(:sponsorship_level, position: 2)
sponsor.update_attributes(sponsorship_level: second_sponsorship_level)
sponsor.update(sponsorship_level: second_sponsorship_level)
end
it 'returns correct url' do
@ -103,7 +105,7 @@ describe ApplicationHelper, type: :helper do
context 'other sponsorship_level' do
before do
other_sponsorship_level = create(:sponsorship_level, position: 3)
sponsor.update_attributes(sponsorship_level: other_sponsorship_level)
sponsor.update(sponsorship_level: other_sponsorship_level)
end
it 'returns correct url' do

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe ConferenceHelper, type: :helper do

View file

@ -1,14 +1,15 @@
# frozen_string_literal: true
require 'spec_helper'
describe DateTimeHelper, type: :helper do
describe 'format_datetime' do
it 'returns nothing if there is no parameter' do
expect(format_datetime(nil)).to eq nil
end
it 'returns formatted string' do
datetime = Time.zone.local(2016, 05, 04, 11, 30)
datetime = Time.zone.local(2016, 0o5, 0o4, 11, 30)
expect(format_datetime(datetime)).to eq '2016-05-04 11:30'
end
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe EventsHelper, type: :helper do

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
describe FormatHelper, type: :helper do
describe 'markdown' do
it 'should return empty string for nil' do
expect(markdown(nil)).to eq ''
@ -9,8 +10,8 @@ describe FormatHelper, type: :helper do
it 'should return HTML for header markdown' do
expect(Redcarpet::Markdown).to receive(:new)
.with(Redcarpet::Render::HTML, autolink: true, space_after_headers: true, no_intra_emphasis: true)
.and_call_original
.with(Redcarpet::Render::HTML, autolink: true, space_after_headers: true, no_intra_emphasis: true)
.and_call_original
expect(markdown('# this is my header')).to eq "<h1>this is my header</h1>\n"
end

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
describe UsersHelper, type: :helper do
describe 'show_roles' do
it 'formats the hash passed' do
roles = { 'organizer' => %w[oSC16 oSC15], 'cfp' => ['oSC16'] }