How does rspec work with Rails 3 for integration tests?

What I'm trying to do is to do integration tests with webrat in rails3 , for example, Yehuda with the test module at http://pivotallabs.com/talks/76-extending-rails-3 minute 34.

example:

describe SomeApp it "should show the index page" visit "/" body.should =~ /hello world/ end end 

Does anyone know how to do this?

+4
source share
4 answers

You tried to use rspec-rails: http://github.com/rspec/rspec-rails

This is the repository (installation instructions in Readme) for the new RSpec 2.0, which will work with Rails 3.

+5
source

thoughtbot just posted a blog post about it.

Stability can become a problem as web applications grow and grow - integration tests provide a great way to run end-to-end tests that test the application as expected.

- RSpec integration tests with Capybara for end-to-end testing

+3
source

Rails 3 support seems to be included in rSpec 2.

+2
source

ceck this link is now very easy to use rspec with rails3 http://github.com/rspec/rspec-rails , and you do not need to run the script / generate rspec_scaffold , as in rails 2.xx, now you just run rails g scaffold , and it will generate rspec files

+1
source

Source: https://habr.com/ru/post/1299311/


All Articles