Conference Controller tests
This commit is contained in:
parent
adfa9cc871
commit
c890aea68d
4 changed files with 258 additions and 0 deletions
16
spec/factories/role.rb
Normal file
16
spec/factories/role.rb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
FactoryGirl.define do
|
||||
factory :role do
|
||||
|
||||
factory :admin_role do
|
||||
name 'Admin'
|
||||
end
|
||||
|
||||
factory :organizer_role do
|
||||
name 'Organizer'
|
||||
end
|
||||
|
||||
factory :participant_role do
|
||||
name 'Participant'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -6,5 +6,17 @@ FactoryGirl.define do
|
|||
password 'changeme'
|
||||
password_confirmation 'changeme'
|
||||
confirmed_at Time.now
|
||||
|
||||
factory :participant do
|
||||
after(:create) { |user| user.role_ids = create(:participant_role).id }
|
||||
end
|
||||
|
||||
factory :admin do
|
||||
after(:create) { |user| user.role_ids = create(:admin_role).id }
|
||||
end
|
||||
|
||||
factory :organizer do
|
||||
after(:create) { |user| user.role_ids = create(:organizer_role).id }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue