summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz1@gmail.com>2016-02-23 14:07:36 +0000
committerJacob Schatz <jschatz1@gmail.com>2016-02-23 14:07:36 +0000
commit06f7fd2fb75293ca2bfeb36dd0552d88a8ca855a (patch)
treecd49573bc8ae59268927187782110840c55aea4a
parentf5be56710f0e71042df98f7f7eefbcfed72d912d (diff)
parent3ec1bffc6c902fa04d7d4281b26225a9d640424e (diff)
downloadgitlab-ce-06f7fd2fb75293ca2bfeb36dd0552d88a8ca855a.tar.gz
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
-rw-r--r--app/views/projects/empty.html.haml2
-rw-r--r--features/explore/projects.feature1
-rw-r--r--features/project/project.feature6
-rw-r--r--features/steps/explore/projects.rb2
-rw-r--r--features/steps/project/project.rb10
-rw-r--r--features/steps/shared/paths.rb4
6 files changed, 23 insertions, 2 deletions
diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml
index b34d106d565..6ad7b05155a 100644
--- a/app/views/projects/empty.html.haml
+++ b/app/views/projects/empty.html.haml
@@ -18,7 +18,7 @@
= link_to "adding README", new_readme_path, class: 'underlined-link'
file to this project.
-- if can?(current_user, :download_code, @project)
+- if can?(current_user, :push_code, @project)
%div{ class: container_class }
.prepend-top-20
.empty_wrapper
diff --git a/features/explore/projects.feature b/features/explore/projects.feature
index 629859e960d..7df6b6f09ba 100644
--- a/features/explore/projects.feature
+++ b/features/explore/projects.feature
@@ -87,6 +87,7 @@ Feature: Explore Projects
Scenario: I visit public project issues page as a non authorized user
Given I visit project "Community" page
+ Then I should not see command line instructions
And I visit "Community" issues page
Then I should see list of issues for "Community" project
diff --git a/features/project/project.feature b/features/project/project.feature
index 1a53945eb04..f1f3ed26065 100644
--- a/features/project/project.feature
+++ b/features/project/project.feature
@@ -86,3 +86,9 @@ Feature: Project
Given I click notifications drop down button
When I choose Mention setting
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
diff --git a/features/steps/explore/projects.rb b/features/steps/explore/projects.rb
index 742ba5d71f6..cb6fa8a47da 100644
--- a/features/steps/explore/projects.rb
+++ b/features/steps/explore/projects.rb
@@ -18,7 +18,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps
end
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
step 'I should see empty public project details with http clone info' do
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
index 37bf52b4a95..ef185861e00 100644
--- a/features/steps/project/project.rb
+++ b/features/steps/project/project.rb
@@ -144,4 +144,14 @@ class Spinach::Features::Project < Spinach::FeatureSteps
expect(page).to have_content 'Notification settings saved'
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
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index f4df4874d2f..0f9835e7356 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -447,6 +447,10 @@ module SharedPaths
visit namespace_project_path(project.namespace, project)
end
+ step "I should not see command line instructions" do
+ expect(page).not_to have_css('.empty_wrapper')
+ end
+
# ----------------------------------------
# Public Projects
# ----------------------------------------