Skip to content

Instantly share code, notes, and snippets.

@bernerdschaefer
Created July 16, 2010 14:48
Show Gist options
  • Save bernerdschaefer/478443 to your computer and use it in GitHub Desktop.
Save bernerdschaefer/478443 to your computer and use it in GitHub Desktop.
# mongoid issue #136
require 'rails'
require 'rspec'
require 'mongoid'
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db('testing')
end
class User
include Mongoid::Document
field :password
field :name
validates :password, :presence => true
validates :name, :presence =>true
collection.remove
end
describe User do
it { should_not be_valid }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment