Roles into their own controller. Rework interface. Add flash messages to ajax calls. Add description to roles. Possible to edit roles in use.

This commit is contained in:
Stella 2015-01-12 23:13:10 +02:00 committed by Stella Rouzi
parent eda5c2bc07
commit ccd7ecbb90
59 changed files with 618 additions and 356 deletions

View file

@ -4,11 +4,10 @@ feature 'BaseController' do
let(:conference) { create(:conference) }
let(:user) { create(:user) }
let!(:organizer_role) { create(:role, name: 'organizer', resource: conference) }
let!(:volunteers_coordinator_role) { create(:role, name: 'volunteers_coordinator', resource: conference) }
let!(:cfp_role) { create(:role, name: 'cfp', resource: conference) }
let!(:info_desk_role) { create(:role, name: 'info_desk', resource: conference) }
let!(:speaker_role) { create(:role, name: 'speaker', resource: conference) }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
let!(:volunteers_coordinator_role) { Role.find_by(name: 'volunteers_coordinator', resource: conference) }
let!(:cfp_role) { Role.find_by(name: 'cfp', resource: conference) }
let!(:info_desk_role) { Role.find_by(name: 'info_desk', resource: conference) }
describe 'GET #verify_user_admin' do
context 'when user is a guest' do
@ -30,14 +29,6 @@ feature 'BaseController' do
expect(flash).to eq 'You are not authorized to access this area!'
end
it 'a speaker it redirects to the root_path' do
user.is_admin = false
user.role_ids = speaker_role.id
visit admin_conference_index_path
expect(current_path).to eq root_path
expect(flash).to eq 'You are not authorized to access this area!'
end
it 'an admin he can access the admin area' do
user.is_admin = true
visit admin_conference_index_path