Fix spec failures for Mongoid 3.

This has no actual changes to Devise itself, just fixes the failing
tests when running against Mongoid 3 instead of Mongoid 2.

Mocha has been locked at 0.10.0 since 0.12.0 raises an error when trying
to set an expectation on a frozen object.

Tests were updated to work with both AR and Mongoid, some cases the XML
serialization was slightly different but both were outputting correct
and valid XML, and the id/_id field mismatch is now handled.

An active field was missing from the test models for Mongoid, and the
invalid :null => true options in field were removed.
This commit is contained in:
Durran Jordan
2012-11-10 20:02:58 +01:00
parent b1df686a2e
commit d821275588
8 changed files with 78 additions and 78 deletions

View File

@@ -1,14 +1,13 @@
require 'mongoid/version'
Mongoid.configure do |config|
config.master = Mongo::Connection.new('127.0.0.1', 27017).db("devise-test-suite")
config.connect_to("devise-test-suite")
config.use_utc = true
config.include_root_in_json = true
end
class ActiveSupport::TestCase
setup do
User.delete_all
Admin.delete_all
Mongoid.purge!
end
end