Linters gonna lint

I was not aware the linting was also applied to specs
This commit is contained in:
Espartaco Palma 2020-01-23 23:31:35 -08:00 committed by Henne Vogelsang
parent f5986f4160
commit 5d79049e59
No known key found for this signature in database
GPG key ID: 9D6164C2955FADE0
2 changed files with 26 additions and 40 deletions

View file

@ -434,7 +434,7 @@ Metrics/BlockNesting:
# Offense count: 13 # Offense count: 13
# Configuration parameters: CountComments. # Configuration parameters: CountComments.
Metrics/ClassLength: Metrics/ClassLength:
Max: 650 Max: 652
# Offense count: 33 # Offense count: 33
Metrics/CyclomaticComplexity: Metrics/CyclomaticComplexity:

View file

@ -3,52 +3,38 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Conference do
let(:subject) { create(:conference, start_date: Date.new(2014, 06, 30), end_date: Date.new(2014, 06, 30)) }
context 'Delegation' do context 'Delegation' do
subject do
FactoryBot.create(:conference, start_date: 1.month.from_now, end_date: 2.month.from_now)
end
context 'Venue' do context 'Venue' do
context 'when venue has not been set' do context 'when venue has not been set' do
it do it 'the accessors should be nil' do
expect(subject.city).to eq(nil) expect(subject.city).to eq(nil)
end
it do
expect(subject.country_name).to eq(nil) expect(subject.country_name).to eq(nil)
end
it do
expect(subject.venue_name).to eq(nil) expect(subject.venue_name).to eq(nil)
end
it do
expect(subject.venue_street).to eq(nil) expect(subject.venue_street).to eq(nil)
end end
end end
context 'when venue has been set' do context 'when venue has been set' do
before(:each) do it 'should delegate to venue' do
venue = FactoryBot.create(:venue)
subject.update(venue: venue) subject.update(venue: venue)
end
let(:venue) do
FactoryBot.create(:venue)
end
it do
expect(subject.city).to eq(venue.city) expect(subject.city).to eq(venue.city)
end
it do
expect(subject.country_name).to eq(venue.country_name) expect(subject.country_name).to eq(venue.country_name)
end
it do
expect(subject.venue_name).to eq(venue.name) expect(subject.venue_name).to eq(venue.name)
end
it do
expect(subject.venue_street).to eq(venue.street) expect(subject.venue_street).to eq(venue.street)
end end
end end
end end
end end
describe Conference do
let(:subject) { create(:conference, start_date: Date.new(2014, 06, 30), end_date: Date.new(2014, 06, 30)) }
describe '#write_event_distribution_to_db' do describe '#write_event_distribution_to_db' do
it 'updates pending conferences' do it 'updates pending conferences' do