Class: RiotRails::ActiveRecord::HasAndBelongsToManyMacro
- Inherits:
-
ReflectionAssertionMacro
- Object
- Riot::AssertionMacro
- ReflectionAssertionMacro
- RiotRails::ActiveRecord::HasAndBelongsToManyMacro
- Defined in:
- lib/riot/active_record/reflection_macros.rb
Overview
An ActiveRecord assertion macro that expects to pass when a given attribute is defined as a has_and_belongs_to_many association. Will fail if an association is not defined for the attribute or if the association is not has_and_belongs_to_many.
context "a Room" do
setup { Room.new }
asserts_topic.has_and_belongs_to_many(:walls)
end
Instance Method Summary (collapse)
Instance Method Details
- (Object) evaluate(actual, *expectings)
99 100 101 102 |
# File 'lib/riot/active_record/reflection_macros.rb', line 99 def evaluate(actual, *expectings) attribute, = *expectings assert_reflection("has_and_belongs_to_many", actual, attribute, ) end |