BigW Consortium Gitlab

dashboard_access_spec.rb 1.87 KB
Newer Older
1 2
require 'spec_helper'

3
describe "Dashboard access", feature: true  do
4 5
  include AccessMatchers

6
  describe "GET /dashboard" do
Douwe Maan committed
7
    subject { dashboard_projects_path }
8

9 10 11
    it { is_expected.to be_allowed_for :admin }
    it { is_expected.to be_allowed_for :user }
    it { is_expected.to be_denied_for :visitor }
12 13 14 15 16
  end

  describe "GET /dashboard/issues" do
    subject { issues_dashboard_path }

17 18 19
    it { is_expected.to be_allowed_for :admin }
    it { is_expected.to be_allowed_for :user }
    it { is_expected.to be_denied_for :visitor }
20 21 22 23 24
  end

  describe "GET /dashboard/merge_requests" do
    subject { merge_requests_dashboard_path }

25 26 27
    it { is_expected.to be_allowed_for :admin }
    it { is_expected.to be_allowed_for :user }
    it { is_expected.to be_denied_for :visitor }
28 29
  end

30 31
  describe "GET /dashboard/projects/starred" do
    subject { starred_dashboard_projects_path }
32

33 34 35
    it { is_expected.to be_allowed_for :admin }
    it { is_expected.to be_allowed_for :user }
    it { is_expected.to be_denied_for :visitor }
36 37 38 39 40
  end

  describe "GET /help" do
    subject { help_path }

41 42
    it { is_expected.to be_allowed_for :admin }
    it { is_expected.to be_allowed_for :user }
Douwe Maan committed
43
    it { is_expected.to be_allowed_for :visitor }
44 45 46
  end

  describe "GET /projects/new" do
47 48 49
    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 }
50 51 52
  end

  describe "GET /groups/new" do
53 54 55
    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 }
56
  end
57 58 59 60 61 62 63 64

  describe "GET /profile/groups" do
    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 }
  end
65
end