Posts [ 4 ]

Topic: somethng wrong with test cucumber [solved]

for some reason my test are passing when i dont want them to.

example of a test Feature

Feature: Visitor Page With a list of sites features
In order to learn more about On-Call Architect
As a perspective customer
I want to view company information-
Scenario Outline: Visit private pages
When I go to a private page <Page>-
Then I should see be sent back to the home page
Examples: List of private pages
| Page |
| Location |
| Services |
| Messages |
| Profile |

step_definitions

When /^I go to a private page Location$/ do
visit location_path
end
When /^I go to Home Page$/ do
visit root_path
end

Re: somethng wrong with test cucumber [solved]

Scenario Outline: Visit private pages and i am not registered to the site-
When I go to a private page <Page>
Then I should see "Sign in"
Examples: List of private pages
| Page |
| Page1 |
| Page2 |
| Page3 |

features/step_definitions/visitor_views_site_features.rb

When /^I go to a private page Page$/ do
# visit page_path
end
Then /^I should see "(.*?)"$/ do |text|
if page.respond_to? :should
page.should have_content(text)
else
assert page.has_content?(text)
end
end