views:

1215

answers:

3

Is there a way to do integration tests with Rspec without using Cucumber? I prefer using just plain old Webrat. Thanks.

A: 

As far as I know Rspec is perfectly capable of testing views and controllers as part of integration tests. A quick look around the internet shows this article at Robby on Rails on view testing and some of the Rdocs within RSpec might help.

Hope this points you in the right direction - I'm afraid I use cucumber myself.

Ryan Neufeld
A: 

So far, the only article I found is this

webrat-with-rspec-no-cucumber

gsmendoza
+2  A: 

The latest version of RSpec-Rails (1.2.7) now has integration support. Upgrade then start adding specs to spec/integration or use the 'integration_spec' generator. Configure Webrat in spec/spec_helper.rb and you're set!

Interesting. I wonder why they incorporated integration specs to rspec, given the popularity of cucumber.
gsmendoza
There's many places where Cucumber would be overkill, like testing internal APIs, for example.