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,6 +35,7 @@ $ -> | ||
35 | $('a, button', scope).removeClass 'active' | 35 | $('a, button', scope).removeClass 'active' |
36 | $(@).addClass 'active' | 36 | $(@).addClass 'active' |
37 | $('#project_clone', scope).val $(@).data 'clone' | 37 | $('#project_clone', scope).val $(@).data 'clone' |
38 | + $(".clone").text("").append 'git remote add origin ' + $(@).data 'clone' | ||
38 | 39 | ||
39 | # Ref switcher | 40 | # Ref switcher |
40 | $('.project-refs-select').on 'change', -> | 41 | $('.project-refs-select').on 'change', -> |
app/views/projects/empty.html.haml
@@ -29,7 +29,8 @@ | @@ -29,7 +29,8 @@ | ||
29 | touch README | 29 | touch README |
30 | git add README | 30 | git add README |
31 | git commit -m 'first commit' | 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 | git push -u origin master | 34 | git push -u origin master |
34 | 35 | ||
35 | %fieldset | 36 | %fieldset |
@@ -37,7 +38,8 @@ | @@ -37,7 +38,8 @@ | ||
37 | %pre.dark | 38 | %pre.dark |
38 | :preserve | 39 | :preserve |
39 | cd existing_git_repo | 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 | git push -u origin master | 43 | git push -u origin master |
42 | 44 | ||
43 | - if can? current_user, :remove_project, @project | 45 | - if can? current_user, :remove_project, @project |
features/project/create_project.feature
@@ -9,3 +9,14 @@ Feature: Create Project | @@ -9,3 +9,14 @@ Feature: Create Project | ||
9 | And fill project form with valid data | 9 | And fill project form with valid data |
10 | Then I should see project page | 10 | Then I should see project page |
11 | And I should see empty project instuctions | 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 | \ No newline at end of file | 23 | \ No newline at end of file |
features/steps/project/create_project.rb
@@ -17,4 +17,26 @@ class CreateProject < Spinach::FeatureSteps | @@ -17,4 +17,26 @@ class CreateProject < Spinach::FeatureSteps | ||
17 | page.should have_content "git remote" | 17 | page.should have_content "git remote" |
18 | page.should have_content Project.last.url_to_repo | 18 | page.should have_content Project.last.url_to_repo |
19 | end | 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 | end | 42 | end |