2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2011-10-08 17:36:38 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe "Admin::Projects" do
|
2015-07-22 00:39:18 -04:00
|
|
|
include AccessMatchers
|
|
|
|
|
2011-10-26 09:46:25 -04:00
|
|
|
describe "GET /admin/projects" do
|
2016-12-08 13:59:41 -05:00
|
|
|
subject { admin_projects_path }
|
2012-08-25 13:43:55 -04:00
|
|
|
|
2020-11-23 10:09:37 -05: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
|
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
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
|
|
|
|
|
2011-10-26 09:46:25 -04:00
|
|
|
describe "GET /admin/users" do
|
2012-08-25 13:43:55 -04:00
|
|
|
subject { admin_users_path }
|
|
|
|
|
2020-11-23 10:09:37 -05: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
|
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
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 }
|
|
|
|
|
2020-11-23 10:09:37 -05: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
|
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
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
|