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:
parent
68e4442ec7
commit
c2be9b0c3e
1 changed files with 1 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue