See https://github.com/mongoid/mongoid/blob/master/CHANGELOG.md and mongoid/mongoid#1989, the three methods .count, .size and .length have been rewritten to follow ActiveRecord behavior, which means .size and .lenght are now cached in an instance variable whereas .count always hits the database, hence the failing test.
…pe Integer but BSON::ObjectId
…ot exist anymore in mongoid 3
… deprecation warning.
…tanceMethods deprecation notice