Public area spinach tests

This commit is contained in:
Dmitriy Zaporozhets 2013-07-29 17:07:03 +03:00
parent dd8f090bc8
commit 4de1db1168
3 changed files with 53 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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
# ----------------------------------------