Rspec integration tests without cucumber?
Asked Answered
S

3

12

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

Sensitize answered 10/6, 2009 at 4:55 Comment(0)
C
11

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!

Charger answered 24/6, 2009 at 22:31 Comment(2)
Interesting. I wonder why they incorporated integration specs to rspec, given the popularity of cucumber.Sensitize
There's many places where Cucumber would be overkill, like testing internal APIs, for example.Charger
B
6

We've recently started using RSpec with Capybara over Cucumber. Here is a "beginners" blog post I recently wrote on using RSpec integration tests without cucumber.

End-to-end testing with RSpec integration tests and Capybara

Let me know if you have any questions on getting your system set up.

Brownstone answered 24/10, 2012 at 13:20 Comment(0)
E
0

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.

Enchanter answered 13/6, 2009 at 2:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.