I'm testing rails app with the Cucumber and Capybara/rack_test. I have following step definition:
Then /^I should see '([^']*)'$/ do |content|
visit about_path
response.should have_content(content)
end
where about_path
maps to /about
.
Every time my story fails with the message
Feature: Some Great Feature
So that I can blah-blah
As a Blah-blah
I want blah-blah
Scenario: Show project label on about page # features/about.feature:7
Given I'm on '/about' page # features/step_definitions/about_steps.rb:1
Then I should see 'About' # features/step_definitions/about_steps.rb:5
expected there to be content "About" in "" (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/about_steps.rb:7:in `/^I should see '([^']*)'$/'
features/about.feature:9:in `Then I should see 'About''
Failing Scenarios:
cucumber features/about.feature:7 # Scenario: Show project label on about page
1 scenario (1 failed)
2 steps (1 failed, 1 passed)
Note that actual content is empty. It is empty with every path I've tried.
It is strange because rspecs passes.
Is there anything I could try? Tell me if you need additional information.
save_and_open_page
just aftervisit
, browser shows page without styling, but it definitely not empty. – lambdas