resource log

Just another paikia site. But resourceful one

Webrat: no such file to load — action_controller/integration

When using rspec + webrat for unit testing, always pop up the error on the line: visit(edit_users_path)

Failure/Error: visit('/users/edit')
LoadError: 
 no such file to load -- action_controller/integration

If you confirmed that you have no problem with your routes.rb

The quick fix is go to spec_helper.rb

require "webrat"
require 'webrat/core/matchers'
include Webrat::Methods

Webrat.configure do |config| 
config.mode = :rack
end

and instead of :rails as default, here we use :rack

About these ads

Written by paikia

February 11, 2012 at 8:49 pm

Posted in ruby on rails

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: