diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-11-25 12:32:14 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-11-25 12:32:14 -0600 |
commit | d4754677a34d34d4a0955a04f2cc6571bdc5e82d (patch) | |
tree | 7407f1ef988bfb1b195fceac423b1bccccca443d | |
parent | 759183c822240ee0a550f1f5a556ffc314b68099 (diff) | |
download | rails-d4754677a34d34d4a0955a04f2cc6571bdc5e82d.tar.gz rails-d4754677a34d34d4a0955a04f2cc6571bdc5e82d.tar.bz2 rails-d4754677a34d34d4a0955a04f2cc6571bdc5e82d.zip |
Deprecate assert_valid
-rw-r--r-- | actionpack/lib/action_controller/assertions/model_assertions.rb | 1 | ||||
-rw-r--r-- | actionpack/test/controller/action_pack_assertions_test.rb | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/assertions/model_assertions.rb b/actionpack/lib/action_controller/assertions/model_assertions.rb index d25214bb66..3a7b39b106 100644 --- a/actionpack/lib/action_controller/assertions/model_assertions.rb +++ b/actionpack/lib/action_controller/assertions/model_assertions.rb @@ -11,6 +11,7 @@ module ActionController # assert_valid(model) # def assert_valid(record) + ::ActiveSupport::Deprecation.warn("assert_valid is deprecated. Use assert record.valid? instead", caller) clean_backtrace do assert record.valid?, record.errors.full_messages.join("\n") end diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index 6cad0e2827..ea56048f37 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -461,14 +461,14 @@ class ActionPackAssertionsControllerTest < ActionController::TestCase def test_assert_valid get :get_valid_record - assert_valid assigns('record') + assert_deprecated { assert_valid assigns('record') } end def test_assert_valid_failing get :get_invalid_record begin - assert_valid assigns('record') + assert_deprecated { assert_valid assigns('record') } assert false rescue ActiveSupport::TestCase::Assertion => e end |