Methods
- T
-
- test_before_validation_and_after_validation_callbacks_should_be_called,
- test_before_validation_and_after_validation_callbacks_should_be_called_in_declared_order,
- test_before_validation_and_after_validation_callbacks_should_be_called_with_proc,
- test_deprecated_further_callbacks_should_not_be_called_if_before_validation_returns_false,
- test_further_callbacks_should_be_called_if_after_validation_returns_false,
- test_further_callbacks_should_not_be_called_if_before_validation_throws_abort,
- test_if_condition_is_respected_for_before_validation,
- test_on_condition_is_respected_for_validation_with_matching_context,
- test_on_condition_is_respected_for_validation_without_context,
- test_on_condition_is_respected_for_validation_without_matching_context,
- test_validation_test_should_be_done
Instance Public methods
test_before_validation_and_after_validation_callbacks_should_be_called()
Link
test_before_validation_and_after_validation_callbacks_should_be_called_in_declared_order()
Link
# File activemodel/test/cases/validations/callbacks_test.rb, line 113 def test_before_validation_and_after_validation_callbacks_should_be_called_in_declared_order d = DogWithTwoValidators.new d.valid? assert_equal ['before_validation_marker1', 'before_validation_marker2'], d.history end
test_before_validation_and_after_validation_callbacks_should_be_called_with_proc()
Link
# File activemodel/test/cases/validations/callbacks_test.rb, line 107 def test_before_validation_and_after_validation_callbacks_should_be_called_with_proc d = DogValidatorsAreProc.new d.valid? assert_equal ['before_validation_marker', 'after_validation_marker'], d.history end
test_deprecated_further_callbacks_should_not_be_called_if_before_validation_returns_false()
Link
# File activemodel/test/cases/validations/callbacks_test.rb, line 126 def test_deprecated_further_callbacks_should_not_be_called_if_before_validation_returns_false d = DogDeprecatedBeforeValidatorReturningFalse.new assert_deprecated do output = d.valid? assert_equal [], d.history assert_equal false, output end end
test_further_callbacks_should_be_called_if_after_validation_returns_false()
Link
test_further_callbacks_should_not_be_called_if_before_validation_throws_abort()
Link
test_if_condition_is_respected_for_before_validation()
Link
test_on_condition_is_respected_for_validation_with_matching_context()
Link
# File activemodel/test/cases/validations/callbacks_test.rb, line 83 def test_on_condition_is_respected_for_validation_with_matching_context d = DogValidatorWithOnCondition.new d.valid?(:create) assert_equal ["before_validation_marker", "after_validation_marker"], d.history end
test_on_condition_is_respected_for_validation_without_context()
Link
test_on_condition_is_respected_for_validation_without_matching_context()
Link
test_validation_test_should_be_done()
Link