Module: Mongoid::Matchers::Associations

Included in:
Mongoid::Matchers
Defined in:
lib/matchers/associations.rb

Defined Under Namespace

Classes: HaveAssociationMatcher

Instance Method Summary collapse

Instance Method Details

#be_embedded_in(association_name) ⇒ Object



109
110
111
# File 'lib/matchers/associations.rb', line 109

def be_embedded_in(association_name)
  HaveAssociationMatcher.new(association_name, Mongoid::Associations::EmbeddedIn)
end


121
122
123
# File 'lib/matchers/associations.rb', line 121

def belong_to_related(association_name)
  HaveAssociationMatcher.new(association_name, Mongoid::Associations::BelongsToRelated)
end

#embed_many(association_name) ⇒ Object



105
106
107
# File 'lib/matchers/associations.rb', line 105

def embed_many(association_name)
  HaveAssociationMatcher.new(association_name, Mongoid::Associations::EmbedsMany)
end

#embed_one(association_name) ⇒ Object



101
102
103
# File 'lib/matchers/associations.rb', line 101

def embed_one(association_name)
  HaveAssociationMatcher.new(association_name, Mongoid::Associations::EmbedsOne)
end


117
118
119
# File 'lib/matchers/associations.rb', line 117

def have_many_related(association_name)
  HaveAssociationMatcher.new(association_name, Mongoid::Associations::HasManyRelated)
end


113
114
115
# File 'lib/matchers/associations.rb', line 113

def have_one_related(association_name)
  HaveAssociationMatcher.new(association_name, Mongoid::Associations::HasOneRelated)
end