I one of my applications I had a bunch of tests written with RSpec and Webrat. Unfortunately it seems that Webrat is not longer maintained actively anymore. That’s why it is a good decision to move to Capybara, an active Test Framework for Ruby.
The Migration was so far pretty smooth. Most time it was a simple replacement of code. Most time I had to replace something like this:
response.should contain("STRING_TO_TEST")
With this :
response.body.should match("STRING_TO_TEST")
Otherwise assertions like this caused problems:
response.status.should == 401
That worked again as soon I wrote it like this here:
response.status.should eq(401)
2 times I got the error message that response is nil. That I could resolve by assigning it explicitly.
response = post @project_uri, {:api_key => @user_api.api_key}, "HTTPS" => "on" response.status.should eq(403)
Otherwise it worked out pretty good.