I’ve created a test with
rails g integration_test index --webrat
This creates the file:
require 'spec_helper'
describe "Indices" do
describe "GET /indices" do
it "works! (now write some real specs)" do
visit indices_path
response.status.should be(200)
end
end
end
That’s all fine, but the only problem is that this test fails even though indices_path exists:
Failure/Error: response.status.should be(200)
NoMethodError:
undefined method `status' for nil:NilClass
So it seems like response is nil.
I can still use page (e.g. page.should have_content works perfectly), but not response. I’d really just like to know that the response status was 200. Can I use something other than response?
If
pageis available, it looks like you may havecapybarainstead ofwebrat. You can try this: