From 139d707cfeb007f3cf30f39a38deb0eec6817a47 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 7 Jul 2020 18:09:24 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../show/user_sees_git_instructions_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'spec/features/projects/show/user_sees_git_instructions_spec.rb') 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..f7f1d7e81d6 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,25 @@ 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) + .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) } -- cgit v1.2.3