Sha256: 3e07c818c174345bd04b646f107e8ff35ae43bdcc70c44dfc8d068b014537b97
Contents?: true
Size: 619 Bytes
Versions: 27
Compression:
Stored size: 619 Bytes
Contents
require 'spec_helper' describe MongoDoc::Validations do class ValidationTest include MongoDoc::Document attr_accessor :data validates_presence_of :data end context "requirements" do subject { ValidationTest.new } it { should respond_to(:valid?) } it { should respond_to(:errors) } it "is included by Document" do ::ActiveModel::Validations.should === subject end end context "validations" do it "valid? fails when a document is invalid" do doc = ValidationTest.new doc.should_not be_valid doc.should have(1).error_on(:data) end end end
Version data entries
27 entries across 27 versions & 2 rubygems