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
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 650
Max: 652
# Offense count: 33
Metrics/CyclomaticComplexity:

View file

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