diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml index ac7b9ee7f2d8143744882f40f7f8b4f285077ff4..097c81100ba0eebc461b7c35a93f9605ed5b8a8a 100644 --- a/app/views/shared/_clone_panel.html.haml +++ b/app/views/shared/_clone_panel.html.haml @@ -1,4 +1,4 @@ .git-clone-holder - %button{class: "btn active", :"data-clone" => @project.ssh_url_to_repo} SSH - %button{class: "btn", :"data-clone" => @project.http_url_to_repo}= gitlab_config.protocol.upcase - = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5", readonly: true + %button{class: "btn #{ current_user ? 'active' : '' }", :"data-clone" => @project.ssh_url_to_repo} SSH + %button{class: "btn #{ current_user ? '' : 'active' }", :"data-clone" => @project.http_url_to_repo}= gitlab_config.protocol.upcase + = text_field_tag :project_clone, (current_user ? @project.url_to_repo : @project.http_url_to_repo), class: "one_click_select span5", readonly: true diff --git a/features/public/public_projects.feature b/features/public/public_projects.feature index 86bb888fdb6b66cfdf94468de5fdaedcd34d2572..03825dffd3ff36f47189113a4c1bc49a24762b9c 100644 --- a/features/public/public_projects.feature +++ b/features/public/public_projects.feature @@ -38,3 +38,14 @@ Feature: Public Projects Feature Given I sign in as a user When I visit project "Internal" page Then I should see project "Internal" home page + + Scenario: I visit public project page + When I visit project "Community" page + Then I should see project "Community" home page + And I should see a http link to the repository + + Scenario: I visit public area as user + Given I sign in as a user + When I visit project "Community" page + Then I should see project "Community" home page + And I should see a ssh link to the repository diff --git a/features/steps/public/projects_feature.rb b/features/steps/public/projects_feature.rb index 8b61eba3ffb0e912877e3a4352921921a709e23c..a4209bb9c78bbc3c7b0e06607aed55c36219fdec 100644 --- a/features/steps/public/projects_feature.rb +++ b/features/steps/public/projects_feature.rb @@ -83,5 +83,15 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps page.should have_content 'Internal' end end + + Then 'I should see a http link to the repository' do + project = Project.find_by_name 'Community' + page.should have_field('project_clone', with: project.http_url_to_repo) + end + + Then 'I should see a ssh link to the repository' do + project = Project.find_by_name 'Community' + page.should have_field('project_clone', with: project.url_to_repo) + end end