mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
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
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/ClassLength:
|
||||
Max: 650
|
||||
Max: 652
|
||||
|
||||
# Offense count: 33
|
||||
Metrics/CyclomaticComplexity:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue