From 47628ec12816fb47f2decdfa8733362d6ef31d22 Mon Sep 17 00:00:00 2001 From: prasath Date: Wed, 8 Feb 2012 00:23:03 +0530 Subject: replacing ordered hash to ruby hash --- activemodel/test/cases/errors_test.rb | 2 +- activemodel/test/cases/serializers/json_serialization_test.rb | 4 ++-- activemodel/test/cases/validations_test.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'activemodel/test') diff --git a/activemodel/test/cases/errors_test.rb b/activemodel/test/cases/errors_test.rb index ab80f193b6..3a4ae4a6e9 100644 --- a/activemodel/test/cases/errors_test.rb +++ b/activemodel/test/cases/errors_test.rb @@ -154,7 +154,7 @@ class ErrorsTest < ActiveModel::TestCase test 'to_hash should return an ordered hash' do person = Person.new person.errors.add(:name, "can not be blank") - assert_instance_of ActiveSupport::OrderedHash, person.errors.to_hash + assert_instance_of ::Hash, person.errors.to_hash end test 'full_messages should return an array of error messages, with the attribute name included' do diff --git a/activemodel/test/cases/serializers/json_serialization_test.rb b/activemodel/test/cases/serializers/json_serialization_test.rb index 4ac5fb1779..7160635eb4 100644 --- a/activemodel/test/cases/serializers/json_serialization_test.rb +++ b/activemodel/test/cases/serializers/json_serialization_test.rb @@ -130,13 +130,13 @@ class JsonSerializationTest < ActiveModel::TestCase assert_match %r{"favorite_quote":"Constraints are liberating"}, methods_json end - test "should return OrderedHash for errors" do + test "should return Hash for errors" do contact = Contact.new contact.errors.add :name, "can't be blank" contact.errors.add :name, "is too short (minimum is 2 characters)" contact.errors.add :age, "must be 16 or over" - hash = ActiveSupport::OrderedHash.new + hash = {} hash[:name] = ["can't be blank", "is too short (minimum is 2 characters)"] hash[:age] = ["must be 16 or over"] assert_equal hash.to_json, contact.errors.to_json diff --git a/activemodel/test/cases/validations_test.rb b/activemodel/test/cases/validations_test.rb index 0b1de62a48..a716d0896e 100644 --- a/activemodel/test/cases/validations_test.rb +++ b/activemodel/test/cases/validations_test.rb @@ -180,7 +180,7 @@ class ValidationsTest < ActiveModel::TestCase assert_match %r{Title can't be blank}, xml assert_match %r{Content can't be blank}, xml - hash = ActiveSupport::OrderedHash.new + hash = {} hash[:title] = ["can't be blank"] hash[:content] = ["can't be blank"] assert_equal t.errors.to_json, hash.to_json -- cgit v1.2.3