Merge 7822a8d4e3 into 6cde2a5f4a
This commit is contained in:
commit
19855d9cba
9 changed files with 469 additions and 34 deletions
|
|
@ -32,6 +32,11 @@ describe 'User' do
|
|||
|
||||
let(:registration) { create(:registration) }
|
||||
|
||||
let(:conference_with_open_registration) { create(:conference) }
|
||||
let!(:open_registration_period) { create(:registration_period, conference: conference_with_open_registration, start_date: Date.current - 6.days) }
|
||||
let(:conference_with_closed_registration) { create(:conference) }
|
||||
let!(:closed_registration_period) { create(:registration_period, conference: conference_with_closed_registration, start_date: Date.current - 6.days, end_date: Date.current - 6.days) }
|
||||
|
||||
# Test abilities for not signed in users
|
||||
context 'when user is not signed in' do
|
||||
it{ should be_able_to(:index, Conference)}
|
||||
|
|
@ -54,8 +59,11 @@ describe 'User' do
|
|||
|
||||
it{ should be_able_to(:show, User)}
|
||||
|
||||
it{ should be_able_to(:create, Registration)}
|
||||
it{ should be_able_to(:show, Registration.new)}
|
||||
it{ should be_able_to(:create, Registration.new(conference_id: conference_with_open_registration.id))}
|
||||
it{ should be_able_to(:new, Registration.new(conference_id: conference_with_open_registration.id))}
|
||||
it{ should_not be_able_to(:new, Registration.new(conference_id: conference_with_closed_registration.id))}
|
||||
it{ should_not be_able_to(:create, Registration.new(conference_id: conference_with_closed_registration.id))}
|
||||
it{ should_not be_able_to(:manage, registration)}
|
||||
|
||||
it{ should be_able_to(:create, Event)}
|
||||
|
|
@ -79,6 +87,8 @@ describe 'User' do
|
|||
|
||||
it{ should be_able_to(:manage, registration_public) }
|
||||
it{ should be_able_to(:manage, registration_not_public) }
|
||||
it{ should_not be_able_to(:new, Registration.new(conference_id: conference_with_closed_registration.id))}
|
||||
it{ should_not be_able_to(:create, Registration.new(conference_id: conference_with_closed_registration.id))}
|
||||
|
||||
it{ should be_able_to(:index, Ticket) }
|
||||
it{ should be_able_to(:manage, TicketPurchase.new(user_id: user.id)) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue