2013-09-25 07:04:16 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2014-04-12 04:56:37 -04:00
|
|
|
describe "Dashboard access", feature: true do
|
2015-07-21 22:09:02 -04:00
|
|
|
include AccessMatchers
|
|
|
|
|
2013-09-25 07:04:16 -04:00
|
|
|
describe "GET /dashboard" do
|
2015-09-08 12:14:02 -04:00
|
|
|
subject { dashboard_projects_path }
|
2013-09-25 07:04:16 -04:00
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
2013-09-25 07:04:16 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /dashboard/issues" do
|
|
|
|
subject { issues_dashboard_path }
|
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
2013-09-25 07:04:16 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /dashboard/merge_requests" do
|
|
|
|
subject { merge_requests_dashboard_path }
|
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
2013-09-25 07:04:16 -04:00
|
|
|
end
|
|
|
|
|
2015-03-10 19:06:30 -04:00
|
|
|
describe "GET /dashboard/projects/starred" do
|
|
|
|
subject { starred_dashboard_projects_path }
|
2013-09-25 07:04:16 -04:00
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
|
|
|
it { is_expected.to be_denied_for :visitor }
|
2013-09-25 07:04:16 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /help" do
|
|
|
|
subject { help_path }
|
|
|
|
|
2015-02-12 13:17:35 -05:00
|
|
|
it { is_expected.to be_allowed_for :admin }
|
|
|
|
it { is_expected.to be_allowed_for :user }
|
2015-09-09 05:22:19 -04:00
|
|
|
it { is_expected.to be_allowed_for :visitor }
|
2013-09-25 07:04:16 -04:00
|
|
|
end
|
|
|
|
|
2016-07-25 23:59:39 -04:00
|
|
|
describe "GET /koding" do
|
|
|
|
subject { koding_path }
|
|
|
|
|
|
|
|
context 'with Koding enabled' do
|
|
|
|
before do
|
|
|
|
stub_application_setting(koding_enabled?: true)
|
|
|
|
end
|
|
|
|
|
|
|
|
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
|
|
|
|
end
|
|
|
|
|
2013-09-25 07:04:16 -04:00
|
|
|
describe "GET /projects/new" do
|
2015-02-12 13:17:35 -05:00
|
|
|
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 }
|
2013-09-25 07:04:16 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /groups/new" do
|
2015-02-12 13:17:35 -05:00
|
|
|
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 }
|
2013-09-25 07:04:16 -04:00
|
|
|
end
|
2015-03-08 23:52:22 -04:00
|
|
|
|
|
|
|
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
|
2013-09-25 07:04:16 -04:00
|
|
|
end
|