Module: NoBrainer::Matchers::Associations

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

Defined Under Namespace

Classes: HaveAssociationMatcher

Constant Summary collapse

HAS_MANY =
NoBrainer::Document::Association::HasMany
HAS_MANY_THROUGH =
NoBrainer::Document::Association::HasManyThrough
HAS_ONE =
NoBrainer::Document::Association::HasOne
HAS_ONE_THROUGH =
NoBrainer::Document::Association::HasOneThrough
BELONGS_TO =
NoBrainer::Document::Association::BelongsTo

Instance Method Summary collapse

Instance Method Details



281
282
283
# File 'lib/matchers/associations.rb', line 281

def belong_to_related(association_name)
  HaveAssociationMatcher.new(association_name, BELONGS_TO)
end


276
277
278
# File 'lib/matchers/associations.rb', line 276

def have_many_related(association_name)
  HaveAssociationMatcher.new(association_name, HAS_MANY)
end


271
272
273
# File 'lib/matchers/associations.rb', line 271

def have_one_related(association_name)
  HaveAssociationMatcher.new(association_name, HAS_ONE)
end