Methods
T
Instance Public methods
test_before_validation_and_after_validation_callbacks_should_be_called()
# File activemodel/test/cases/validations/callbacks_test.rb, line 101
def test_before_validation_and_after_validation_callbacks_should_be_called
  d = DogWithMethodCallbacks.new
  d.valid?
  assert_equal ['before_validation_marker', 'after_validation_marker'], d.history
end
test_before_validation_and_after_validation_callbacks_should_be_called_in_declared_order()
# 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()
# 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()
# 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()
# File activemodel/test/cases/validations/callbacks_test.rb, line 135
def test_further_callbacks_should_be_called_if_after_validation_returns_false
  d = DogAfterValidatorReturningFalse.new
  d.valid?
  assert_equal ['after_validation_marker'], d.history
end
test_further_callbacks_should_not_be_called_if_before_validation_throws_abort()
# File activemodel/test/cases/validations/callbacks_test.rb, line 119
def test_further_callbacks_should_not_be_called_if_before_validation_throws_abort
  d = DogBeforeValidatorThrowingAbort.new
  output = d.valid?
  assert_equal [], d.history
  assert_equal false, output
end
test_if_condition_is_respected_for_before_validation()
# File activemodel/test/cases/validations/callbacks_test.rb, line 77
def test_if_condition_is_respected_for_before_validation
  d = DogValidatorWithIfCondition.new
  d.valid?
  assert_equal ["before_validation_marker1", "after_validation_marker1"], d.history
end
test_on_condition_is_respected_for_validation_with_matching_context()
# 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()
# File activemodel/test/cases/validations/callbacks_test.rb, line 95
def test_on_condition_is_respected_for_validation_without_context
  d = DogValidatorWithOnCondition.new
  d.valid?
  assert_equal [], d.history
end
test_on_condition_is_respected_for_validation_without_matching_context()
# File activemodel/test/cases/validations/callbacks_test.rb, line 89
def test_on_condition_is_respected_for_validation_without_matching_context
  d = DogValidatorWithOnCondition.new
  d.valid?(:save)
  assert_equal [], d.history
end
test_validation_test_should_be_done()
# File activemodel/test/cases/validations/callbacks_test.rb, line 141
def test_validation_test_should_be_done
  d = DogWithMissingName.new
  output = d.valid?
  assert_equal ['before_validation_marker'], d.history
  assert_equal false, output
end