diff options
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) } |