Allow the track organizer to manage events

He/She can manage the events of his/her tracks and their commercials
This commit is contained in:
AEtherC0r3 2017-08-09 14:53:27 +03:00 committed by Stella Rouzi
parent a87c6e55f7
commit af7efdb6fe
4 changed files with 34 additions and 9 deletions

View file

@ -4,7 +4,7 @@ feature 'Has correct abilities' do
let(:organization) { create(:organization) }
let(:conference) { create(:full_conference, organization: organization) }
let(:self_organized_track) { create(:track, :self_organized, program: conference.program) }
let(:self_organized_track) { create(:track, :self_organized, program: conference.program, state: 'confirmed', cfp_active: true) }
let(:role_track_organizer) { Role.where(name: 'track_organizer', resource: self_organized_track).first_or_create }
let(:user_track_organizer) { create(:user, role_ids: [role_track_organizer.id]) }
@ -28,12 +28,12 @@ feature 'Has correct abilities' do
expect(page).to_not have_link('Lodgings', href: "/admin/conferences/#{conference.short_title}/lodgings")
expect(page).to have_link('Program', href: "/admin/conferences/#{conference.short_title}/program")
expect(page).to_not have_link('Call for Papers', href: "/admin/conferences/#{conference.short_title}/program/cfps")
expect(page).to_not have_link('Events', href: "/admin/conferences/#{conference.short_title}/program/events")
expect(page).to have_link('Events', href: "/admin/conferences/#{conference.short_title}/program/events")
expect(page).to have_link('Tracks', href: "/admin/conferences/#{conference.short_title}/program/tracks")
expect(page).to_not have_link('Event Types', href: "/admin/conferences/#{conference.short_title}/program/event_types")
expect(page).to_not have_link('Difficulty Levels', href: "/admin/conferences/#{conference.short_title}/program/difficulty_levels")
expect(page).to_not have_link('Schedules', href: "/admin/conferences/#{conference.short_title}/schedules")
expect(page).to_not have_link('Reports', href: "/admin/conferences/#{conference.short_title}/program/reports")
expect(page).to have_link('Reports', href: "/admin/conferences/#{conference.short_title}/program/reports")
expect(page).to_not have_link('Registrations', href: "/admin/conferences/#{conference.short_title}/registrations")
expect(page).to_not have_link('Registration Period', href: "/admin/conferences/#{conference.short_title}/registration_period")
expect(page).to_not have_link('Questions', href: "/admin/conferences/#{conference.short_title}/questions")
@ -101,12 +101,16 @@ feature 'Has correct abilities' do
expect(current_path).to eq root_path
visit admin_conference_program_events_path(conference.short_title)
expect(current_path).to eq root_path
expect(current_path).to eq admin_conference_program_events_path(conference.short_title)
create(:event, program: conference.program)
visit edit_admin_conference_program_event_path(conference.short_title, conference.program.events.first)
expect(current_path).to eq root_path
self_organized_track_event = create(:event, program: conference.program, track: self_organized_track)
visit edit_admin_conference_program_event_path(conference.short_title, self_organized_track_event)
expect(current_path).to eq(edit_admin_conference_program_event_path(conference.short_title, self_organized_track_event))
visit admin_conference_program_event_types_path(conference.short_title)
expect(current_path).to eq root_path
@ -219,7 +223,7 @@ feature 'Has correct abilities' do
expect(current_path).to eq admin_conference_program_track_path(conference.short_title, self_organized_track)
visit edit_admin_conference_program_track_path(conference.short_title, self_organized_track)
expect(current_path).to eq edit_admin_conference_program_track_path(conference.short_title, self_organized_track)
expect(current_path).to eq root_path
visit admin_conference_roles_path(conference.short_title)
expect(current_path).to eq admin_conference_roles_path(conference.short_title)