开发者

Using rspec with Webrat instead of Capybara

开发者 https://www.devze.com 2023-01-20 17:43 出处:网络
I 开发者_如何学Pythonhave been using rspec with webrat and decided to add cucumber for high level tests.

I 开发者_如何学Pythonhave been using rspec with webrat and decided to add cucumber for high level tests.

After installing cucumber with capybara, for some reason rspec also switched to using it.

Is there a way to tell rspec to continue using webrat ?


Make sure you have both webrat and capybara in your Gemfile, and add the following to your /spec/spec_helper.rb:

require "webrat"
Webrat.configure do |config|
    config.mode = :rails
end

I've just switched to capybara, but my view specs stopped working because capybara has no 'have_selector'. Guess you had a similar problem, well, now it's (hopefully) solved.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号