Sha256: ad4eac751e9d3ebc3358a0e89059af6a5799d96ca8b49e939a7da179468624fa

Contents?: true

Size: 649 Bytes

Versions: 3

Compression:

Stored size: 649 Bytes

Contents

require 'test_helper'

describe "Associations" do
  describe Person do
    subject { Person }

    it { must have_many(:pets).of_type(Pet).as_inverse_of(:owner) }
    it { must have_one(:account).of_type(Account) }
    it { must have_and_belong_to_many(:friends).of_type(Person) }

    it { must embed_one(:profile) }
    it { must embed_many(:sites) }
  end

  describe Pet do
    subject { Pet }

    it { must belong_to(:owner).of_type(Person) }
  end

  describe Account do
    subject { Account }

    it { must belong_to(:person).of_type(Person) }
  end

  describe Site do
    subject { Site }

    it { must embedded_in(:person) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-minitest-1.2.0 test/matchers/associations_test.rb
mongoid-minitest-1.1.0 test/matchers/associations_test.rb
mongoid-minitest-1.0.0 test/matchers/associations_test.rb