0x4a6f4672
0x4a6f4672

Reputation: 28245

no such file to load -- action_controller/integration - NoMethodError for Rails 3 and Webrat

I'm getting the following failure during RSpec tests..

no such file to load -- action_controller/integration

..using Rails 3, RSpec 2 and Webrat, if I include the Webrat helpers in the following way (the idea was to use Webrat for the have_tag and have_selector methods instead of assert_select).

RSpec.configure do |config|
  ..
  config.include Webrat::HaveTagMatcher
end

Yet apparently Webrat and Rails 3 are not compatible yet. One solution is to avoid the Webrat gem and to use assert_select instead. Has anyone a better solution? How do you avoid the error?

Upvotes: 3

Views: 943

Answers (1)

0x4a6f4672
0x4a6f4672

Reputation: 28245

I have not found a solution for this problem, only a work around. You can use the have_selector method of Capybara instead of Webrat, at least in RSpec request tests. There are certain difficulties with RSpec2 and Capybara (page.should have_selector only works if you use Capybara's 'visit' method, and not the RSpec method get '/some/path'), but basically it works.

Upvotes: 1

Related Questions