diff --git a/features/public/public_projects.feature b/features/public/public_projects.feature new file mode 100644 index 00000000000..c4f1b6203e7 --- /dev/null +++ b/features/public/public_projects.feature @@ -0,0 +1,14 @@ +Feature: Public Projects Feature + Background: + Given public project "Community" + And private project "Enterprise" + + Scenario: I visit public area + When I visit the public projects area + Then I should see project "Community" + And I should not see project "Enterprise" + + Scenario: I visit public project page + When I visit public page for "Community" project + Then I should see public project details + And I should see project readme diff --git a/features/steps/public/projects_feature.rb b/features/steps/public/projects_feature.rb new file mode 100644 index 00000000000..8d612498fb9 --- /dev/null +++ b/features/steps/public/projects_feature.rb @@ -0,0 +1,35 @@ +class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps + include SharedPaths + + step 'I should see project "Community"' do + page.should have_content "Community" + end + + step 'I should not see project "Enterprise"' do + page.should_not have_content "Enterprise" + end + + step 'I should see public project details' do + page.should have_content '32 branches' + page.should have_content '16 tags' + end + + step 'I should see project readme' do + page.should have_content 'README.md' + end + + step 'public project "Community"' do + create :project_with_code, name: 'Community', public: true + end + + step 'private project "Enterprise"' do + create :project, name: 'Enterprise' + end + + private + + def project + @project ||= Project.find_by_name("Community") + end +end + diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 67e14121c6d..eb91ed23737 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -275,6 +275,10 @@ module SharedPaths visit public_root_path end + step 'I visit public page for "Community" project' do + visit public_project_path(Project.find_by_name("Community")) + end + # ---------------------------------------- # Snippets # ----------------------------------------