debian-mirror-gitlab/spec/features/security/admin_access_spec.rb

53 lines
1.3 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2014-09-02 18:07:02 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe "Admin::Projects" do
2015-09-11 14:41:01 +05:30
include AccessMatchers
2014-09-02 18:07:02 +05:30
describe "GET /admin/projects" do
2017-08-17 22:00:37 +05:30
subject { admin_projects_path }
2014-09-02 18:07:02 +05:30
2021-02-22 17:27:13 +05:30
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
2015-04-26 12:48:37 +05:30
it { is_expected.to be_denied_for :user }
it { is_expected.to be_denied_for :visitor }
2014-09-02 18:07:02 +05:30
end
describe "GET /admin/users" do
subject { admin_users_path }
2021-02-22 17:27:13 +05:30
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
2015-04-26 12:48:37 +05:30
it { is_expected.to be_denied_for :user }
it { is_expected.to be_denied_for :visitor }
2014-09-02 18:07:02 +05:30
end
describe "GET /admin/hooks" do
subject { admin_hooks_path }
2021-02-22 17:27:13 +05:30
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
2015-04-26 12:48:37 +05:30
it { is_expected.to be_denied_for :user }
it { is_expected.to be_denied_for :visitor }
2014-09-02 18:07:02 +05:30
end
end