Class: MR::TestHelpers::FieldSavedAssertionBase
- Inherits:
-
Object
- Object
- MR::TestHelpers::FieldSavedAssertionBase
- Defined in:
- lib/mr/test_helpers.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(model, field, expected_value) ⇒ FieldSavedAssertionBase
constructor
A new instance of FieldSavedAssertionBase.
Constructor Details
#initialize(model, field, expected_value) ⇒ FieldSavedAssertionBase
Returns a new instance of FieldSavedAssertionBase.
110 111 112 113 114 115 116 117 118 |
# File 'lib/mr/test_helpers.rb', line 110 def initialize(model, field, expected_value) if !model.record.kind_of?(MR::FakeRecord) raise ArgumentError, "model must be using a fake record" end @expected_value = expected_value @field = field.to_s @saved = model.record.saved_attributes.key?(@field) @saved_as = model.record.saved_attributes[@field] end |