Add permission to access admin/shedule by cfp#1432

This commit is contained in:
nasia 2017-04-07 14:36:18 +03:00
parent e28d681eb8
commit 11938025cf
3 changed files with 4 additions and 3 deletions

View file

@ -198,6 +198,7 @@ class Ability
can :manage, Track, program: { conference_id: conf_ids_for_cfp }
can :manage, DifficultyLevel, program: { conference_id: conf_ids_for_cfp }
can :manage, EmailSettings, conference_id: conf_ids_for_cfp
can :manage, Schedule, program: { conference_id: conf_ids_for_cfp }
can :manage, Room, venue: { conference_id: conf_ids_for_cfp }
can :show, Venue, conference_id: conf_ids_for_cfp
can :show, Commercial, commercialable_type: 'Venue', commercialable_id: Venue.where(conference_id: conf_ids_for_cfp).pluck(:id)

View file

@ -129,7 +129,7 @@ feature 'Has correct abilities' do
expect(page).to have_link('Commercials', href: "/admin/conferences/#{conference2.short_title}/commercials")
expect(page).to have_link('Events', href: "/admin/conferences/#{conference2.short_title}/program/events")
expect(page).to_not have_link('Registrations', href: "/admin/conferences/#{conference2.short_title}/registrations")
expect(page).to_not have_link('Schedules', href: "/admin/conferences/#{conference2.short_title}/schedules")
expect(page).to have_link('Schedules', href: "/admin/conferences/#{conference2.short_title}/schedules")
expect(page).to_not have_link('Campaigns', href: "/admin/conferences/#{conference2.short_title}/campaigns")
expect(page).to_not have_link('Goals', href: "/admin/conferences/#{conference2.short_title}/targets")
expect(page).to have_link('Venue', href: "/admin/conferences/#{conference2.short_title}/venue")
@ -161,7 +161,7 @@ feature 'Has correct abilities' do
expect(current_path).to eq(admin_conference_program_events_path(conference2.short_title))
visit admin_conference_schedules_path(conference2.short_title)
expect(current_path).to eq(root_path)
expect(current_path).to eq(admin_conference_schedules_path(conference2.short_title))
visit admin_conference_campaigns_path(conference2.short_title)
expect(current_path).to eq(root_path)

View file

@ -274,7 +274,7 @@ describe 'User' do
it{ should_not be_able_to(:manage, conference_public.questions.first) }
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_schedule) }
it{ should be_able_to(:manage, my_schedule) }
it{ should_not be_able_to(:manage, other_schedule) }
it{ should_not be_able_to(:manage, my_event_schedule) }
it{ should_not be_able_to(:manage, other_event_schedule) }