[rspec-users] mock_model with Rspec/Rspec-rails 1.2 and Rails 2.3
tom at zudio.com.au
Wed Mar 18 01:00:23 EDT 2009
Not sure if anyone has faced this problem yet and managed to resolve
it... I understand Rspec 'decoupled' the mock frameworks, however it
works fine with Rails 2.2 but fails in 2.3...
Can anyone give me any pointers as to what changes are required in
spec_helper.rb to ensure mock_model methods are available?
Within console I can mock an object with the following:
=> #<User:0x1c04c10 @name="User_1001">
However, within spec_helper.rb
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/
Spec::Runner.configure do |config|
With the above settings when our specs run (while on rails 2.3 and
rspec 1.2), the following error occurs :
undefined method `mock_model=' for #<User:0x2d5887c>
Any pointers in the right direction would be much appreciated...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users