module Mongoid::Matchers::Associations

Constants

BELONGS_TO
EMBEDDED_IN
EMBEDS_MANY
EMBEDS_ONE
HAS_AND_BELONGS_TO_MANY
HAS_MANY
HAS_ONE

Public Instance Methods

belong_to(association_name) click to toggle source
# File lib/matchers/associations/associations.rb, line 150
def belong_to association_name
  HaveAssociationMatcher.new association_name, BELONGS_TO
end
embed_many(association_name) click to toggle source
# File lib/matchers/associations/associations.rb, line 158
def embed_many association_name
  HaveAssociationMatcher.new association_name, EMBEDS_MANY
end
embed_one(association_name) click to toggle source
# File lib/matchers/associations/associations.rb, line 154
def embed_one association_name
  HaveAssociationMatcher.new association_name, EMBEDS_ONE
end
embedded_in(association_name) click to toggle source
# File lib/matchers/associations/associations.rb, line 162
def embedded_in association_name
  HaveAssociationMatcher.new association_name, EMBEDDED_IN
end
have_and_belong_to_many(association_name) click to toggle source
# File lib/matchers/associations/associations.rb, line 146
def have_and_belong_to_many association_name
  HaveAssociationMatcher.new association_name, HAS_AND_BELONGS_TO_MANY
end
have_many(association_name) click to toggle source
# File lib/matchers/associations/associations.rb, line 142
def have_many association_name
  HaveAssociationMatcher.new association_name, HAS_MANY
end
have_one(association_name) click to toggle source
# File lib/matchers/associations/associations.rb, line 138
def have_one association_name
  HaveAssociationMatcher.new association_name, HAS_ONE
end