gitlab-org--gitlab-foss/spec/features/security/admin_access_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.3 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
2011-10-08 17:36:38 -04:00
require 'spec_helper'
RSpec.describe "Admin::Projects" do
include AccessMatchers
describe "GET /admin/projects" do
subject { admin_projects_path }
2012-08-25 13:43:55 -04:00
context 'when admin mode is enabled', :enable_admin_mode do
it { is_expected.to be_allowed_for :admin }
end
context 'when admin mode is disabled' do
it { is_expected.to be_denied_for :admin }
end
it { is_expected.to be_denied_for :user }
it { is_expected.to be_denied_for :visitor }
2011-10-08 17:36:38 -04:00
end
describe "GET /admin/users" do
2012-08-25 13:43:55 -04:00
subject { admin_users_path }
context 'when admin mode is enabled', :enable_admin_mode do
it { is_expected.to be_allowed_for :admin }
end
context 'when admin mode is disabled' do
it { is_expected.to be_denied_for :admin }
end
it { is_expected.to be_denied_for :user }
it { is_expected.to be_denied_for :visitor }
2011-10-08 17:36:38 -04:00
end
2012-07-15 10:36:06 -04:00
describe "GET /admin/hooks" do
2012-08-25 13:43:55 -04:00
subject { admin_hooks_path }
context 'when admin mode is enabled', :enable_admin_mode do
it { is_expected.to be_allowed_for :admin }
end
context 'when admin mode is disabled' do
it { is_expected.to be_denied_for :admin }
end
it { is_expected.to be_denied_for :user }
it { is_expected.to be_denied_for :visitor }
2011-10-08 17:36:38 -04:00
end
end