1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Simplify keys order test for as_json in Active Model

This commit is contained in:
Carlos Antonio da Silva 2012-11-30 10:20:49 -02:00
parent 68e4442ec7
commit c2be9b0c3e

View file

@ -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