mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Introducing delegation for city and country name (Conference - Venue
Using ActiveSupport delegate macro.
This commit is contained in:
parent
f50a92bf53
commit
fd2635509f
2 changed files with 45 additions and 0 deletions
|
|
@ -7,6 +7,48 @@ 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 '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
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#write_event_distribution_to_db' do
|
||||
|
||||
it 'updates pending conferences' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue