diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/features/projects/show/user_sees_git_instructions_spec.rb | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/features/projects/show/user_sees_git_instructions_spec.rb')
-rw-r--r-- | spec/features/projects/show/user_sees_git_instructions_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/features/projects/show/user_sees_git_instructions_spec.rb b/spec/features/projects/show/user_sees_git_instructions_spec.rb index a35f6420bdc..3b77fd7eebf 100644 --- a/spec/features/projects/show/user_sees_git_instructions_spec.rb +++ b/spec/features/projects/show/user_sees_git_instructions_spec.rb @@ -18,6 +18,8 @@ RSpec.describe 'Projects > Show > User sees Git instructions' do page.within '.empty-wrapper' do expect(page).to have_content('Command line instructions') end + + expect(page).to have_content("git push -u origin master") end end @@ -59,6 +61,26 @@ RSpec.describe 'Projects > Show > User sees Git instructions' do include_examples 'shows details of empty project with no repo' end + context ":default_branch_name is specified" do + let_it_be(:project) { create(:project, :public) } + + before do + expect(Gitlab::CurrentSettings) + .to receive(:default_branch_name) + .at_least(:once) + .and_return('example_branch') + + sign_in(project.owner) + visit project_path(project) + end + + it "recommends default_branch_name instead of master" do + click_link 'Create empty repository' + + expect(page).to have_content("git push -u origin example_branch") + end + end + context 'when project is empty' do let_it_be(:project) { create(:project_empty_repo, :public) } |