I am trying to write an Rspec request specification using Capybara. Everything seems to work correctly except that Capybara sees the page blank.
Good signs:
- The page loads fine in the browser
- Bringing the log into the log shows that the correct view is displayed during the test run.
- Any registration applications that I place in the submissions are executed.
- If I use
assert_select "h1", :text => "hello world" , the test passes.
Bad signs:
- If I use
page.should have_content('hello world') , it fails saying Capybara::ElementNotFound: Unable to find xpath "/html" - If I do
$stdout.puts page.html , it is empty except for doctype
My test looks something like this:
describe "working with foos" do it "should have a 'new foo' form" do get '/foos/new' assert_select 'h1', text: 'hello world'
What could be wrong here?
source share