Remove assumption from test that first user is admin
This commit is contained in:
parent
0619eb7963
commit
d2b392e119
8 changed files with 6 additions and 21 deletions
|
|
@ -20,7 +20,6 @@ feature 'Has correct abilities' do
|
|||
let(:user_volunteer_coordinator) { create(:user, role_ids: [role_volunteer_coordinator.id]) }
|
||||
|
||||
scenario 'when user has no role' do
|
||||
user.is_admin = false
|
||||
sign_in user
|
||||
|
||||
visit admin_conference_path(conference1.short_title)
|
||||
|
|
@ -29,7 +28,6 @@ feature 'Has correct abilities' do
|
|||
end
|
||||
|
||||
scenario 'when user is organizer' do
|
||||
user_organizer.is_admin = false
|
||||
sign_in user_organizer
|
||||
|
||||
visit admin_conference_path(conference1.short_title)
|
||||
|
|
@ -107,7 +105,6 @@ feature 'Has correct abilities' do
|
|||
end
|
||||
|
||||
scenario 'when user is cfp' do
|
||||
user_cfp.is_admin = false
|
||||
sign_in user_cfp
|
||||
|
||||
visit admin_conference_path(conference2.short_title)
|
||||
|
|
@ -182,7 +179,6 @@ feature 'Has correct abilities' do
|
|||
end
|
||||
|
||||
scenario 'when user is info desk' do
|
||||
user_info_desk.is_admin = false
|
||||
sign_in user_info_desk
|
||||
|
||||
visit admin_conference_path(conference3.short_title)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue