summaryrefslogtreecommitdiff
path: root/spec/features/projects_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-03 10:11:19 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-03 10:11:19 +0000
commit9a1e9397b4e378e052af12c697a9fbfd70a24bf5 (patch)
treebda9287282dfaefa0c717f092947f79839e07102 /spec/features/projects_spec.rb
parent9fb816facef888b8fcdbc443af304105c480547b (diff)
downloadgitlab-ce-9a1e9397b4e378e052af12c697a9fbfd70a24bf5.tar.gz
Add latest changes from gitlab-org/security/gitlab@14-5-stable-ee
Diffstat (limited to 'spec/features/projects_spec.rb')
-rw-r--r--spec/features/projects_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb
index c4619b5498e..26deca9c8f1 100644
--- a/spec/features/projects_spec.rb
+++ b/spec/features/projects_spec.rb
@@ -383,6 +383,24 @@ RSpec.describe 'Project' do
{ form: '.rspec-merge-request-settings', input: '#project_printing_merge_request_link_enabled' }]
end
+ describe 'view for a user without an access to a repo' do
+ let(:project) { create(:project, :repository) }
+ let(:user) { create(:user) }
+
+ it 'does not contain default branch information in its content' do
+ default_branch = 'merge-commit-analyze-side-branch'
+
+ project.add_guest(user)
+ project.change_head(default_branch)
+
+ sign_in(user)
+ visit project_path(project)
+
+ lines_with_default_branch = page.html.lines.select { |line| line.include?(default_branch) }
+ expect(lines_with_default_branch).to eq([])
+ end
+ end
+
def remove_with_confirm(button_text, confirm_with, confirm_button_text = 'Confirm')
click_button button_text
fill_in 'confirm_name_input', with: confirm_with