diff options
author | André Luís <me@andr3.net> | 2018-02-23 09:00:19 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-02-23 09:00:19 +0000 |
commit | da531c39057f7216f367cfb8b9e4768bd9728a61 (patch) | |
tree | c65e00b7f69a19d956fdc69777fadda2ec4b7d7c /spec/helpers/projects_helper_spec.rb | |
parent | 7834f63c07dd52965e3aa30262d2b8f130c955aa (diff) | |
download | gitlab-ce-da531c39057f7216f367cfb8b9e4768bd9728a61.tar.gz |
Add Tip about Push to Create project on New Project page
Diffstat (limited to 'spec/helpers/projects_helper_spec.rb')
-rw-r--r-- | spec/helpers/projects_helper_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index a160cc9d5ec..b643a3590c8 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -436,6 +436,22 @@ describe ProjectsHelper do end end + describe('#push_to_create_project_command') do + let(:user) { create(:user, username: 'john') } + + it 'returns the command to push to create project over HTTP' do + allow(Gitlab::CurrentSettings.current_application_settings).to receive(:enabled_git_access_protocol) { 'http' } + + expect(helper.push_to_create_project_command(user)).to eq('git push --set-upstream http://test.host/john/$(git rev-parse --show-toplevel | xargs basename).git $(git rev-parse --abbrev-ref HEAD)') + end + + it 'returns the command to push to create project over SSH' do + allow(Gitlab::CurrentSettings.current_application_settings).to receive(:enabled_git_access_protocol) { 'ssh' } + + expect(helper.push_to_create_project_command(user)).to eq('git push --set-upstream git@localhost:john/$(git rev-parse --show-toplevel | xargs basename).git $(git rev-parse --abbrev-ref HEAD)') + end + end + describe '#any_projects?' do let!(:project) { create(:project) } |