Commit 06f7fd2f authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'empty-repo-instructions-fix' into 'master'

Users don't get instructions to push to other users empty projects

Fixes #12518

![Screen_Shot_2016-02-22_at_17.38.18](/uploads/42a3c32af1326f15a7b40fd7153a89fb/Screen_Shot_2016-02-22_at_17.38.18.png)

See merge request !2923
parents f5be5671 3ec1bffc
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
= link_to "adding README", new_readme_path, class: 'underlined-link' = link_to "adding README", new_readme_path, class: 'underlined-link'
file to this project. file to this project.
- if can?(current_user, :download_code, @project) - if can?(current_user, :push_code, @project)
%div{ class: container_class } %div{ class: container_class }
.prepend-top-20 .prepend-top-20
.empty_wrapper .empty_wrapper
......
...@@ -87,6 +87,7 @@ Feature: Explore Projects ...@@ -87,6 +87,7 @@ Feature: Explore Projects
Scenario: I visit public project issues page as a non authorized user Scenario: I visit public project issues page as a non authorized user
Given I visit project "Community" page Given I visit project "Community" page
Then I should not see command line instructions
And I visit "Community" issues page And I visit "Community" issues page
Then I should see list of issues for "Community" project Then I should see list of issues for "Community" project
......
...@@ -86,3 +86,9 @@ Feature: Project ...@@ -86,3 +86,9 @@ Feature: Project
Given I click notifications drop down button Given I click notifications drop down button
When I choose Mention setting When I choose Mention setting
Then I should see Notification saved message Then I should see Notification saved message
Scenario: I should see command line instructions
Given I own an empty project
And I visit my empty project page
And I create bare repo
Then I should see command line instructions
...@@ -18,7 +18,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps ...@@ -18,7 +18,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
end end
step 'I should see empty public project details' do step 'I should see empty public project details' do
expect(page).to have_content 'Git global setup' expect(page).not_to have_content 'Git global setup'
end end
step 'I should see empty public project details with http clone info' do step 'I should see empty public project details with http clone info' do
......
...@@ -144,4 +144,14 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -144,4 +144,14 @@ class Spinach::Features::Project < Spinach::FeatureSteps
expect(page).to have_content 'Notification settings saved' expect(page).to have_content 'Notification settings saved'
end end
end end
step 'I create bare repo' do
click_link 'Create empty bare repository'
end
step 'I should see command line instructions' do
page.within ".empty_wrapper" do
expect(page).to have_content("Command line instructions")
end
end
end end
...@@ -447,6 +447,10 @@ module SharedPaths ...@@ -447,6 +447,10 @@ module SharedPaths
visit namespace_project_path(project.namespace, project) visit namespace_project_path(project.namespace, project)
end end
step "I should not see command line instructions" do
expect(page).not_to have_css('.empty_wrapper')
end
# ---------------------------------------- # ----------------------------------------
# Public Projects # Public Projects
# ---------------------------------------- # ----------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment