Remove assumption from test that first user is admin

This commit is contained in:
Aditya Prakash 2016-03-12 15:18:45 +05:30
parent 0619eb7963
commit d2b392e119
8 changed files with 6 additions and 21 deletions

View file

@ -23,7 +23,6 @@ feature 'BaseController' do
end
it 'not an admin it redirects to root_path' do
user.is_admin = false
visit admin_conference_index_path
expect(current_path).to eq root_path
expect(flash).to eq 'You are not authorized to access this area!'
@ -36,28 +35,24 @@ feature 'BaseController' do
end
it 'an organizer he can access the admin area' do
user.is_admin = false
user.role_ids = organizer_role.id
visit admin_conference_index_path
expect(current_path).to eq admin_conference_index_path
end
it 'a volunteers_coordinator he can access the admin area' do
user.is_admin = false
user.role_ids = volunteers_coordinator_role.id
visit admin_conference_index_path
expect(current_path).to eq admin_conference_index_path
end
it 'a cfp he can access the admin area' do
user.is_admin = false
user.role_ids = cfp_role.id
visit admin_conference_index_path
expect(current_path).to eq admin_conference_index_path
end
it 'an info_desk he can access the admin area' do
user.is_admin = false
user.role_ids = info_desk_role.id
visit admin_conference_index_path
expect(current_path).to eq admin_conference_index_path