Browse files

Simplify keys order test for as_json in Active Model

  • Loading branch information...
carlosantoniodasilva committed Nov 30, 2012
1 parent 68e4442 commit c2be9b0c3e78c1ea8132fbf7c632fcb91611a9ac
Showing with 1 addition and 4 deletions.
  1. +1 −4 activemodel/test/cases/serializers/json_serialization_test.rb
@@ -157,11 +157,8 @@ def @contact.favorite_quote; "Constraints are liberating"; end
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
test "from_json should work without a root (class attribute)" do

0 comments on commit c2be9b0

Please sign in to comment.