mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 11:44:02 +00:00
Remove superflous spec for User.registered/attended
There is no logic involved, just a map on the title...
This commit is contained in:
parent
c78733a2fb
commit
50d6f5b3d5
2 changed files with 0 additions and 39 deletions
|
|
@ -237,7 +237,6 @@ class User < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def registered
|
def registered
|
||||||
registrations = self.registrations
|
|
||||||
if registrations.count == 0
|
if registrations.count == 0
|
||||||
'None'
|
'None'
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -305,44 +305,6 @@ describe User do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#registered' do
|
|
||||||
context 'user has not registered to any conference' do
|
|
||||||
it 'returns None' do
|
|
||||||
expect(user.registered).to eq 'None'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'user has registered to conferences' do
|
|
||||||
before do
|
|
||||||
create(:registration, user: user, conference: conference)
|
|
||||||
create(:registration, user: user, conference: conference2)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns registered conferences title' do
|
|
||||||
expect(user.registered).to eq('openSUSE Conference 2016, openSUSE Conference 2015')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '#attended' do
|
|
||||||
context 'user has not attended any conference' do
|
|
||||||
it 'returns None' do
|
|
||||||
expect(user.attended).to eq 'None'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'user has attended conferences' do
|
|
||||||
before do
|
|
||||||
create(:registration, user: user, conference: conference, attended: true)
|
|
||||||
create(:registration, user: user, conference: conference2, attended: true)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns attended conferences title' do
|
|
||||||
expect(user.attended).to eq('openSUSE Conference 2016, openSUSE Conference 2015')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '#confirmed?' do
|
describe '#confirmed?' do
|
||||||
context 'confirmed user' do
|
context 'confirmed user' do
|
||||||
it 'returns true' do
|
it 'returns true' do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue