Merge f952dd7c9b into 139a8565e2
This commit is contained in:
commit
96a92670c6
8 changed files with 44 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ FactoryGirl.define do
|
|||
end_date { 6.days.from_now }
|
||||
registration_limit 0
|
||||
description { Faker::Hipster.paragraph }
|
||||
payment_method 'offline'
|
||||
|
||||
after(:create) do |conference|
|
||||
Role.where(name: 'organizer', resource: conference).first_or_create(description: 'For the organizers of the conference (who shall have full access)')
|
||||
|
|
|
|||
|
|
@ -1545,6 +1545,20 @@ describe Conference do
|
|||
should validate_presence_of(:end_date)
|
||||
end
|
||||
|
||||
it 'is not valid without payment mode' do
|
||||
should validate_presence_of(:payment_method)
|
||||
end
|
||||
|
||||
it 'is valid with payment mode as Online' do
|
||||
should allow_value('online').for(:payment_method).
|
||||
with_message("'%{value}' is not a valid payment method")
|
||||
end
|
||||
|
||||
it 'is valid with payment mode as Offline' do
|
||||
should allow_value('offline').for(:payment_method).
|
||||
with_message("'%{value}' is not a valid payment method")
|
||||
end
|
||||
|
||||
it 'is not valid with a duplicate short title' do
|
||||
should validate_uniqueness_of(:short_title)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue