Commit 6113d80639241476ff07afa7cf12e3ee927f3b25
Exists in
master
and in
4 other branches
Merge branch 'remote_url_in_project_blank_slate' of /home/git/repositories/gitlab/gitlabhq
Showing
4 changed files
with
38 additions
and
2 deletions
Show diff stats
app/assets/javascripts/project.js.coffee
... | ... | @@ -35,6 +35,7 @@ $ -> |
35 | 35 | $('a, button', scope).removeClass 'active' |
36 | 36 | $(@).addClass 'active' |
37 | 37 | $('#project_clone', scope).val $(@).data 'clone' |
38 | + $(".clone").text("").append 'git remote add origin ' + $(@).data 'clone' | |
38 | 39 | |
39 | 40 | # Ref switcher |
40 | 41 | $('.project-refs-select').on 'change', -> | ... | ... |
app/views/projects/empty.html.haml
... | ... | @@ -29,7 +29,8 @@ |
29 | 29 | touch README |
30 | 30 | git add README |
31 | 31 | git commit -m 'first commit' |
32 | - git remote add origin #{@project.url_to_repo} | |
32 | + %span.clone= "git remote add origin #{@project.url_to_repo}" | |
33 | + :preserve | |
33 | 34 | git push -u origin master |
34 | 35 | |
35 | 36 | %fieldset |
... | ... | @@ -37,7 +38,8 @@ |
37 | 38 | %pre.dark |
38 | 39 | :preserve |
39 | 40 | cd existing_git_repo |
40 | - git remote add origin #{@project.url_to_repo} | |
41 | + %span.clone= "git remote add origin #{@project.url_to_repo}" | |
42 | + :preserve | |
41 | 43 | git push -u origin master |
42 | 44 | |
43 | 45 | - if can? current_user, :remove_project, @project | ... | ... |
features/project/create_project.feature
... | ... | @@ -9,3 +9,14 @@ Feature: Create Project |
9 | 9 | And fill project form with valid data |
10 | 10 | Then I should see project page |
11 | 11 | And I should see empty project instuctions |
12 | + | |
13 | + @javascript | |
14 | + Scenario: Empty project instructions | |
15 | + Given I sign in as a user | |
16 | + When I visit new project page | |
17 | + And fill project form with valid data | |
18 | + Then I see empty project instuctions | |
19 | + And I click on HTTP | |
20 | + Then Remote url should update to http link | |
21 | + And If I click on SSH | |
22 | + Then Remote url should update to ssh link | |
12 | 23 | \ No newline at end of file | ... | ... |
features/steps/project/create_project.rb
... | ... | @@ -17,4 +17,26 @@ class CreateProject < Spinach::FeatureSteps |
17 | 17 | page.should have_content "git remote" |
18 | 18 | page.should have_content Project.last.url_to_repo |
19 | 19 | end |
20 | + | |
21 | + Then 'I see empty project instuctions' do | |
22 | + page.should have_content "git init" | |
23 | + page.should have_content "git remote" | |
24 | + page.should have_content Project.last.url_to_repo | |
25 | + end | |
26 | + | |
27 | + And 'I click on HTTP' do | |
28 | + click_button 'HTTP' | |
29 | + end | |
30 | + | |
31 | + Then 'Remote url should update to http link' do | |
32 | + page.should have_content "git remote add origin #{Project.last.http_url_to_repo}" | |
33 | + end | |
34 | + | |
35 | + And 'If I click on SSH' do | |
36 | + click_button 'SSH' | |
37 | + end | |
38 | + | |
39 | + Then 'Remote url should update to ssh link' do | |
40 | + page.should have_content "git remote add origin #{Project.last.url_to_repo}" | |
41 | + end | |
20 | 42 | end | ... | ... |