From c2be9b0c3e78c1ea8132fbf7c632fcb91611a9ac Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 30 Nov 2012 10:20:49 -0200 Subject: [PATCH] Simplify keys order test for as_json in Active Model --- .../test/cases/serializers/json_serialization_test.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/activemodel/test/cases/serializers/json_serialization_test.rb b/activemodel/test/cases/serializers/json_serialization_test.rb index fd4d068354..9134c4980c 100644 --- a/activemodel/test/cases/serializers/json_serialization_test.rb +++ b/activemodel/test/cases/serializers/json_serialization_test.rb @@ -157,11 +157,8 @@ class JsonSerializationTest < ActiveModel::TestCase test "as_json should keep the default order in the hash" do json = @contact.as_json - keys = json.keys - %w(name age created_at awesome preferences).each_with_index do |field, index| - assert_equal keys.index(field), index - end + assert_equal %w(name age created_at awesome preferences), json.keys end test "from_json should work without a root (class attribute)" do