Linters gonna lint
I was not aware the linting was also applied to specs
This commit is contained in:
parent
f5986f4160
commit
5d79049e59
2 changed files with 26 additions and 40 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -3,51 +3,37 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
require 'spec_helper'
|
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 'Venue' do
|
||||||
|
context 'when venue has not been set' do
|
||||||
context 'Delegation' do
|
it 'the accessors should be nil' do
|
||||||
context 'Venue' do
|
expect(subject.city).to eq(nil)
|
||||||
context 'when venue has not been set' do
|
expect(subject.country_name).to eq(nil)
|
||||||
it do
|
expect(subject.venue_name).to eq(nil)
|
||||||
expect(subject.city).to eq(nil)
|
expect(subject.venue_street).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
|
|
||||||
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
|
||||||
subject.update(venue: venue)
|
venue = FactoryBot.create(:venue)
|
||||||
end
|
subject.update(venue: venue)
|
||||||
|
expect(subject.city).to eq(venue.city)
|
||||||
let(:venue) do
|
expect(subject.country_name).to eq(venue.country_name)
|
||||||
FactoryBot.create(:venue)
|
expect(subject.venue_name).to eq(venue.name)
|
||||||
end
|
expect(subject.venue_street).to eq(venue.street)
|
||||||
|
|
||||||
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
|
|
||||||
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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue