Introduce Program to include cfp/rooms/tracks/events/event_types/difficulty_levels
This commit is contained in:
parent
028b82fda8
commit
444356fbc7
117 changed files with 1812 additions and 905 deletions
|
|
@ -11,7 +11,8 @@ describe 'User' do
|
|||
let(:user){ nil }
|
||||
|
||||
let(:conference_not_public) { create(:conference, splashpage: create(:splashpage, public: false)) }
|
||||
let(:conference_public) { create(:full_conference, splashpage: create(:splashpage, public: true), call_for_paper: create(:call_for_paper, schedule_public: true)) }
|
||||
let(:conference_public) { create(:full_conference, splashpage: create(:splashpage, public: true)) }
|
||||
let!(:conference_public_cfp) { create(:cfp, program: conference_public.program) }
|
||||
|
||||
let(:event_confirmed) { create(:event, state: 'confirmed') }
|
||||
let(:event_unconfirmed) { create(:event) }
|
||||
|
|
@ -28,7 +29,11 @@ describe 'User' do
|
|||
it{ should be_able_to(:show, conference_public)}
|
||||
it{ should_not be_able_to(:show, conference_not_public)}
|
||||
|
||||
it{ should be_able_to(:schedule, conference_public)}
|
||||
it do
|
||||
conference_public.program.schedule_public = true
|
||||
conference_public.program.save
|
||||
should be_able_to(:schedule, conference_public)
|
||||
end
|
||||
it{ should_not be_able_to(:schedule, conference_not_public)}
|
||||
|
||||
it{ should be_able_to(:show, event_confirmed)}
|
||||
|
|
@ -89,12 +94,13 @@ describe 'User' do
|
|||
|
||||
context 'when user has the role organizer' do
|
||||
let!(:my_conference) { create(:full_conference) }
|
||||
let!(:my_cfp) { create(:cfp, program: my_conference.program) }
|
||||
let(:role) { create(:organizer_role, resource: my_conference) }
|
||||
let(:user) { create(:user, role_ids: [role.id], is_admin: false) }
|
||||
let(:registration) { create(:registration, conference: my_conference) }
|
||||
let(:other_registration) { create(:registration, conference: conference_public) }
|
||||
let(:event) { create(:event_full, conference: my_conference) }
|
||||
let(:other_event) { create(:event_full, conference: conference_public) }
|
||||
let(:event) { create(:event_full, program: my_conference.program) }
|
||||
let(:other_event) { create(:event_full, program: conference_public.program) }
|
||||
|
||||
it{ should be_able_to([:create, :new], Conference) }
|
||||
it{ should be_able_to(:manage, my_conference) }
|
||||
|
|
@ -115,8 +121,8 @@ describe 'User' do
|
|||
it{ should_not be_able_to(:manage, conference_public.registration_period) }
|
||||
it{ should be_able_to(:manage, my_conference.questions.first) }
|
||||
it{ should_not be_able_to(:manage, conference_public.questions.first) }
|
||||
it{ should be_able_to(:manage, my_conference.call_for_paper) }
|
||||
it{ should_not be_able_to(:manage, conference_public.call_for_paper) }
|
||||
it{ should be_able_to(:manage, my_conference.program.cfp) }
|
||||
it{ should_not be_able_to(:manage, conference_public.program.cfp) }
|
||||
it{ should be_able_to(:manage, my_conference.venue) }
|
||||
it{ should_not be_able_to(:manage, conference_public.venue) }
|
||||
it{ should be_able_to(:manage, my_conference.lodgings.first) }
|
||||
|
|
@ -147,12 +153,13 @@ describe 'User' do
|
|||
|
||||
context 'when user has the role cfp' do
|
||||
let!(:my_conference) { create(:full_conference) }
|
||||
let!(:my_cfp) { create(:cfp, program: my_conference.program) }
|
||||
let(:role) { create(:cfp_role, resource: my_conference) }
|
||||
let(:user) { create(:user, role_ids: [role.id], is_admin: false) }
|
||||
let(:registration) { create(:registration, conference: my_conference) }
|
||||
let(:other_registration) { create(:registration, conference: conference_public) }
|
||||
let(:event) { create(:event_full, conference: my_conference) }
|
||||
let(:other_event) { create(:event_full, conference: conference_public) }
|
||||
let(:event) { create(:event_full, program: my_conference.program) }
|
||||
let(:other_event) { create(:event_full, program: conference_public.program) }
|
||||
|
||||
it{ should_not be_able_to([:create, :new], Conference.new) }
|
||||
it{ should_not be_able_to(:manage, my_conference) }
|
||||
|
|
@ -173,8 +180,8 @@ describe 'User' do
|
|||
it{ should_not be_able_to(:manage, conference_public.registration_period) }
|
||||
it{ should_not be_able_to(:manage, my_conference.questions.first) }
|
||||
it{ should_not be_able_to(:manage, conference_public.questions.first) }
|
||||
it{ should be_able_to(:manage, my_conference.call_for_paper) }
|
||||
it{ should_not be_able_to(:manage, conference_public.call_for_paper) }
|
||||
it{ should be_able_to(:manage, my_conference.program.cfp) }
|
||||
it{ should_not be_able_to(:manage, conference_public.program.cfp) }
|
||||
it{ should_not be_able_to(:manage, my_conference.venue) }
|
||||
it{ should be_able_to(:show, my_conference.venue) }
|
||||
it{ should_not be_able_to(:manage, conference_public.venue) }
|
||||
|
|
@ -206,12 +213,13 @@ describe 'User' do
|
|||
|
||||
context 'when user has the role info_desk' do
|
||||
let!(:my_conference) { create(:full_conference) }
|
||||
let!(:my_cfp) { create(:cfp, program: my_conference.program) }
|
||||
let(:role) { create(:info_desk_role, resource: my_conference) }
|
||||
let(:user) { create(:user, role_ids: [role.id], is_admin: false) }
|
||||
let(:registration) { create(:registration, conference: my_conference) }
|
||||
let(:other_registration) { create(:registration, conference: conference_public) }
|
||||
let(:event) { create(:event_full, conference: my_conference) }
|
||||
let(:other_event) { create(:event_full, conference: conference_public) }
|
||||
let(:event) { create(:event_full, program: my_conference.program) }
|
||||
let(:other_event) { create(:event_full, program: conference_public.program) }
|
||||
|
||||
it{ should_not be_able_to([:create, :new], Conference.new) }
|
||||
it{ should_not be_able_to(:manage, my_conference) }
|
||||
|
|
@ -232,8 +240,8 @@ describe 'User' do
|
|||
it{ should_not be_able_to(:manage, conference_public.registration_period) }
|
||||
it{ should be_able_to(:manage, my_conference.questions.first) }
|
||||
it{ should_not be_able_to(:manage, conference_public.questions.first) }
|
||||
it{ should_not be_able_to(:manage, my_conference.call_for_paper) }
|
||||
it{ should_not be_able_to(:manage, conference_public.call_for_paper) }
|
||||
it{ should_not be_able_to(:manage, my_conference.program.cfp) }
|
||||
it{ should_not be_able_to(:manage, conference_public.program.cfp) }
|
||||
it{ should_not be_able_to(:manage, my_conference.venue) }
|
||||
it{ should_not be_able_to(:show, my_conference.venue) }
|
||||
it{ should_not be_able_to(:manage, conference_public.venue) }
|
||||
|
|
@ -265,12 +273,13 @@ describe 'User' do
|
|||
|
||||
context 'when user has the role volunteers_coordinator' do
|
||||
let!(:my_conference) { create(:full_conference) }
|
||||
let!(:my_cfp) { create(:cfp, program: my_conference.program) }
|
||||
let(:role) { create(:volunteers_coordinator_role, resource: my_conference) }
|
||||
let(:user) { create(:user, role_ids: [role.id], is_admin: false) }
|
||||
let(:registration) { create(:registration, conference: my_conference) }
|
||||
let(:other_registration) { create(:registration, conference: conference_public) }
|
||||
let(:event) { create(:event_full, conference: my_conference) }
|
||||
let(:other_event) { create(:event_full, conference: conference_public) }
|
||||
let(:event) { create(:event_full, program: my_conference.program) }
|
||||
let(:other_event) { create(:event_full, program: conference_public.program) }
|
||||
|
||||
it{ should_not be_able_to([:create, :new], Conference.new) }
|
||||
it{ should_not be_able_to(:manage, my_conference) }
|
||||
|
|
@ -291,8 +300,8 @@ describe 'User' do
|
|||
it{ should_not be_able_to(:manage, conference_public.registration_period) }
|
||||
it{ should_not be_able_to(:manage, my_conference.questions.first) }
|
||||
it{ should_not be_able_to(:manage, conference_public.questions.first) }
|
||||
it{ should_not be_able_to(:manage, my_conference.call_for_paper) }
|
||||
it{ should_not be_able_to(:manage, conference_public.call_for_paper) }
|
||||
it{ should_not be_able_to(:manage, my_conference.program.cfp) }
|
||||
it{ should_not be_able_to(:manage, conference_public.program.cfp) }
|
||||
it{ should_not be_able_to(:manage, my_conference.venue) }
|
||||
it{ should_not be_able_to(:show, my_conference.venue) }
|
||||
it{ should_not be_able_to(:manage, conference_public.venue) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue