Sha256: e9b1e76ca36abca92bd6c4950f214e3a9413cbff60a51cf1b79ef3a5db27034e

Contents?: true

Size: 940 Bytes

Versions: 8

Compression:

Stored size: 940 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Mongoa::MongoMapper::Matchers do
  before(:all) do
    class TesterClass
      include Mongoa::MongoMapper::Matchers
    end
  end
  
  before(:each) do
    @tester = TesterClass.new
  end

  describe "associations" do
    it "should expose a belong_to, have_many and have_one methods" do
      @tester.methods.should include(:belong_to)
      @tester.methods.should include(:have_many)
      @tester.methods.should include(:have_one)
    end
  end
  
  describe "validations" do
    it "should expose validate_presence_of, validate_inclusion_of, validates_uniqueness_of and validate_length_of methods" do
      @tester.methods.should include(:validate_presence_of)
      @tester.methods.should include(:validate_inclusion_of)
      @tester.methods.should include(:validate_uniqueness_of)
      @tester.methods.should include(:validate_length_of)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mongoa-0.2.4 spec/matchers_spec.rb
mongoa-0.2.3 spec/matchers_spec.rb
mongoa-0.2.2 spec/matchers_spec.rb
mongoa-0.2.1 spec/matchers_spec.rb
mongoa-0.1.17 spec/matchers_spec.rb
mongoa-0.1.16 spec/matchers_spec.rb
mongoa-0.1.15 spec/matchers_spec.rb
mongoa-0.1.14 spec/matchers_spec.rb