Rspec integration tests without cucumber?

2019-03-18 17:43发布

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

4条回答
欢心
2楼-- · 2019-03-18 17:46

Check this link http://railscasts.com/episodes/257-request-specs-and-capybara at RailsCasts. This is a nice episode of doing integration tests with rspec.

查看更多
我只想做你的唯一
3楼-- · 2019-03-18 17:52

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!

查看更多
萌系小妹纸
4楼-- · 2019-03-18 17:58

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.

查看更多
够拽才男人
5楼-- · 2019-03-18 18:08

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.

查看更多
登录 后发表回答