Module: Shoulda::Matchers::ActiveRecord

Defined in:
lib/beyond_the_api_test_helpers/shoulda/have_valid_enum.rb,
lib/beyond_the_api_test_helpers/shoulda/have_foreign_key.rb,
lib/beyond_the_api_test_helpers/shoulda/require_association.rb,
lib/beyond_the_api_test_helpers/shoulda/have_valid_association.rb

Defined Under Namespace

Classes: HaveForeignKeyMatcher, HaveValidAssociationMatcher, HaveValidEnumMatcher, RequireAssociationMatcher

Instance Method Summary collapse

Instance Method Details

#have_foreign_key(table, fk) ⇒ Object



4
5
6
# File 'lib/beyond_the_api_test_helpers/shoulda/have_foreign_key.rb', line 4

def have_foreign_key(table, fk)
  HaveForeignKeyMatcher.new(table, fk)
end

#have_valid_association(association) ⇒ Object



4
5
6
# File 'lib/beyond_the_api_test_helpers/shoulda/have_valid_association.rb', line 4

def have_valid_association(association)
  HaveValidAssociationMatcher.new(association)
end

#have_valid_enum(field, enum_klass) ⇒ Object



4
5
6
# File 'lib/beyond_the_api_test_helpers/shoulda/have_valid_enum.rb', line 4

def have_valid_enum(field, enum_klass)
  HaveValidEnumMatcher.new(field, enum_klass)
end

#require_association(association) ⇒ Object



4
5
6
# File 'lib/beyond_the_api_test_helpers/shoulda/require_association.rb', line 4

def require_association(association)
  RequireAssociationMatcher.new(association)
end