diff options
author | Valery Sizov <valery@gitlab.com> | 2016-10-04 15:52:08 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-10-11 16:51:26 +0300 |
commit | b4004488f76d7360acd2f38277d617447c76b888 (patch) | |
tree | d52552cccf8b51ba4e099f0afbb05bf94a1a1472 /spec/features | |
parent | a3169d522a0db269770141a1b30c3df5acee82f3 (diff) | |
download | gitlab-ce-b4004488f76d7360acd2f38277d617447c76b888.tar.gz |
Make guests unable to view MRsguests_cant_see_mrs
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/guest_navigation_menu_spec.rb | 28 | ||||
-rw-r--r-- | spec/features/security/project/private_access_spec.rb | 2 |
2 files changed, 29 insertions, 1 deletions
diff --git a/spec/features/projects/guest_navigation_menu_spec.rb b/spec/features/projects/guest_navigation_menu_spec.rb new file mode 100644 index 00000000000..c22441f8929 --- /dev/null +++ b/spec/features/projects/guest_navigation_menu_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +describe "Guest navigation menu" do + let(:project) { create :empty_project, :private } + let(:guest) { create :user } + + before do + project.team << [guest, :guest] + + login_as(guest) + end + + it "shows allowed tabs only" do + visit namespace_project_path(project.namespace, project) + + within(".nav-links") do + expect(page).to have_content 'Project' + expect(page).to have_content 'Activity' + expect(page).to have_content 'Issues' + expect(page).to have_content 'Wiki' + + expect(page).not_to have_content 'Repository' + expect(page).not_to have_content 'Pipelines' + expect(page).not_to have_content 'Graphs' + expect(page).not_to have_content 'Merge Requests' + end + end +end diff --git a/spec/features/security/project/private_access_spec.rb b/spec/features/security/project/private_access_spec.rb index ccb5c06dab0..79417c769a8 100644 --- a/spec/features/security/project/private_access_spec.rb +++ b/spec/features/security/project/private_access_spec.rb @@ -203,7 +203,7 @@ describe "Private Project Access", feature: true do it { is_expected.to be_allowed_for master } it { is_expected.to be_allowed_for developer } it { is_expected.to be_allowed_for reporter } - it { is_expected.to be_allowed_for guest } + it { is_expected.to be_denied_for guest } it { is_expected.to be_denied_for :user } it { is_expected.to be_denied_for :external } it { is_expected.to be_denied_for :visitor } |