diff options
Diffstat (limited to 'activeresource/test')
-rw-r--r-- | activeresource/test/abstract_unit.rb | 3 | ||||
-rw-r--r-- | activeresource/test/base_errors_test.rb | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/activeresource/test/abstract_unit.rb b/activeresource/test/abstract_unit.rb index 0f11ea482a..ce9371d050 100644 --- a/activeresource/test/abstract_unit.rb +++ b/activeresource/test/abstract_unit.rb @@ -14,6 +14,9 @@ require 'setter_trap' ActiveResource::Base.logger = Logger.new("#{File.dirname(__FILE__)}/debug.log") +# Show backtraces for deprecated behavior for quicker cleanup. +ActiveSupport::Deprecation.debug = true + def uses_gem(gem_name, test_name, version = '> 0') gem gem_name.to_s, version require gem_name.to_s diff --git a/activeresource/test/base_errors_test.rb b/activeresource/test/base_errors_test.rb index 8c177c8006..28813821df 100644 --- a/activeresource/test/base_errors_test.rb +++ b/activeresource/test/base_errors_test.rb @@ -20,7 +20,7 @@ class BaseErrorsTest < Test::Unit::TestCase end def test_should_parse_errors_to_individual_attributes - assert @person.errors.invalid?(:name) + assert @person.errors[:name].any? assert_equal ["can't be blank"], @person.errors[:age] assert_equal ["can't be blank", "must start with a letter"], @person.errors[:name] assert_equal ["Person quota full for today."], @person.errors[:base] @@ -34,7 +34,7 @@ class BaseErrorsTest < Test::Unit::TestCase def test_should_iterate_over_full_errors errors = [] - @person.errors.each_full { |message| errors << message } + @person.errors.to_a.each { |message| errors << message } assert errors.include?("Name can't be blank") end |