2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
RSpec.describe "Dashboard access", feature_category: :system_access do
|
2015-09-11 14:41:01 +05:30
|
|
|
include AccessMatchers
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
describe "GET /dashboard" do
|
2015-09-25 12:07:36 +05:30
|
|
|
subject { dashboard_projects_path }
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /dashboard/issues" do
|
|
|
|
subject { issues_dashboard_path }
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /dashboard/merge_requests" do
|
|
|
|
subject { merge_requests_dashboard_path }
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
describe "GET /dashboard/projects/starred" do
|
|
|
|
subject { starred_dashboard_projects_path }
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /help" do
|
|
|
|
subject { help_path }
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
2015-09-25 12:07:36 +05:30
|
|
|
it { is_expected.to be_allowed_for :visitor }
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /projects/new" do
|
2015-04-26 12:48:37 +05:30
|
|
|
it { expect(new_project_path).to be_allowed_for :admin }
|
|
|
|
it { expect(new_project_path).to be_allowed_for :user }
|
|
|
|
it { expect(new_project_path).to be_denied_for :visitor }
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /groups/new" do
|
2015-04-26 12:48:37 +05:30
|
|
|
it { expect(new_group_path).to be_allowed_for :admin }
|
|
|
|
it { expect(new_group_path).to be_allowed_for :user }
|
|
|
|
it { expect(new_group_path).to be_denied_for :visitor }
|
|
|
|
end
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
describe "GET /dashboard/groups" do
|
2015-04-26 12:48:37 +05:30
|
|
|
subject { dashboard_groups_path }
|
|
|
|
|
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|