It looks like those aliases are not loaded properly. I'm using Rails 3.X, rspec 2.8 and capybara 1.1.2 to write some integration tests. I think that my installation of Capybara is successful as it all works with the standard 'describe' and 'it' tags, but 'feature' and 'scenario' aliases from Capybara throw an 'undefined method' error.
I don't see anything in the documentation mentioning more configuration: https://github.com/jnicklas/capybara I have simply added the 'require capybara/rspec' in my spec_helper.rb
It seems like you can't combine describe/it with feature/scenario syntax. I was getting the same error when I nested a scenario block inside a describe block. Once I replaced the describe with feature, the test ran. One gotcha: It also does not seem to like nested feature blocks, which I guess makes sense in the context of acceptance testing.
describe "some feature" do # <== BAD
scenario "some scenario" do
#spec code here
end
end
feature "some feature" do # <== GOOD
scenario "some scenario" do
#spec code here
end
end
UPDATE
I dug into Capybara's source code, and before and it don't get aliased by background and scenario unless the describe block gets created with capybara_feature => true which happens when you create the block with feature instead of describe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With