aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-30 10:20:49 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-30 10:21:24 -0200
commitc2be9b0c3e78c1ea8132fbf7c632fcb91611a9ac (patch)
tree4938c161611ce93fea6d80e09cc1c64cd4fff981 /activemodel
parent68e4442ec720ca6730959681951f5862f97b5772 (diff)
downloadrails-c2be9b0c3e78c1ea8132fbf7c632fcb91611a9ac.tar.gz
rails-c2be9b0c3e78c1ea8132fbf7c632fcb91611a9ac.tar.bz2
rails-c2be9b0c3e78c1ea8132fbf7c632fcb91611a9ac.zip
Simplify keys order test for as_json in Active Model
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/test/cases/serializers/json_serialization_test.rb5
1 files changed, 1 insertions, 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