Commit 4de1db11685811e06b351fdcfe92c1d7a34e3246
1 parent
dd8f090b
Exists in
master
and in
4 other branches
Public area spinach tests
Showing
3 changed files
with
53 additions
and
0 deletions
Show diff stats
| @@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
| 1 | +Feature: Public Projects Feature | ||
| 2 | + Background: | ||
| 3 | + Given public project "Community" | ||
| 4 | + And private project "Enterprise" | ||
| 5 | + | ||
| 6 | + Scenario: I visit public area | ||
| 7 | + When I visit the public projects area | ||
| 8 | + Then I should see project "Community" | ||
| 9 | + And I should not see project "Enterprise" | ||
| 10 | + | ||
| 11 | + Scenario: I visit public project page | ||
| 12 | + When I visit public page for "Community" project | ||
| 13 | + Then I should see public project details | ||
| 14 | + And I should see project readme |
| @@ -0,0 +1,35 @@ | @@ -0,0 +1,35 @@ | ||
| 1 | +class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps | ||
| 2 | + include SharedPaths | ||
| 3 | + | ||
| 4 | + step 'I should see project "Community"' do | ||
| 5 | + page.should have_content "Community" | ||
| 6 | + end | ||
| 7 | + | ||
| 8 | + step 'I should not see project "Enterprise"' do | ||
| 9 | + page.should_not have_content "Enterprise" | ||
| 10 | + end | ||
| 11 | + | ||
| 12 | + step 'I should see public project details' do | ||
| 13 | + page.should have_content '32 branches' | ||
| 14 | + page.should have_content '16 tags' | ||
| 15 | + end | ||
| 16 | + | ||
| 17 | + step 'I should see project readme' do | ||
| 18 | + page.should have_content 'README.md' | ||
| 19 | + end | ||
| 20 | + | ||
| 21 | + step 'public project "Community"' do | ||
| 22 | + create :project_with_code, name: 'Community', public: true | ||
| 23 | + end | ||
| 24 | + | ||
| 25 | + step 'private project "Enterprise"' do | ||
| 26 | + create :project, name: 'Enterprise' | ||
| 27 | + end | ||
| 28 | + | ||
| 29 | + private | ||
| 30 | + | ||
| 31 | + def project | ||
| 32 | + @project ||= Project.find_by_name("Community") | ||
| 33 | + end | ||
| 34 | +end | ||
| 35 | + |
features/steps/shared/paths.rb
| @@ -275,6 +275,10 @@ module SharedPaths | @@ -275,6 +275,10 @@ module SharedPaths | ||
| 275 | visit public_root_path | 275 | visit public_root_path |
| 276 | end | 276 | end |
| 277 | 277 | ||
| 278 | + step 'I visit public page for "Community" project' do | ||
| 279 | + visit public_project_path(Project.find_by_name("Community")) | ||
| 280 | + end | ||
| 281 | + | ||
| 278 | # ---------------------------------------- | 282 | # ---------------------------------------- |
| 279 | # Snippets | 283 | # Snippets |
| 280 | # ---------------------------------------- | 284 | # ---------------------------------------- |