I happened to mix ryan bates' authentication scaffold with
rspec_scaffold on a demo project.
and ran into the problem of mixing mock frameworks...ryan uses mocha.
So, as a learning experience, I choose to redo ryan's tests without
mocha but ran into a strange problem with tests of the User model.
With debugging you can see....
If you run just the user_spec.rb file, everything is fine....rspec
goes through the User model.
However, if you run all the specs, it is somehow still using mocha
instead of the User model.
How is this possible since I removed the configuration for mocha.?
In spec_helper.rb, I commented out the line: #
config.mock_with :mocha
I also saw a require 'mocha' statement in test_helper that I removed.
---------------------------------------------------------------------------------------------------------------------
11:41 /c/work/quizmaker_demo (questions)$ spec spec
...................................c:/work/quizmaker_demo/spec/models/
user_spec.rb:86
User.authenticate('nonexisting', 'secret').should be_nil
(rdb:1) s
c:/tools/ruby/ruby186/lib/ruby/gems/1.8/gems/mocha-0.9.5/lib/mocha/
class_method.rb:40
stubbee.__metaclass__.class_eval("def #{method}(*args, &block);
mocha.method_missing(:#{method}, *a
(rdb:1) c