aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activemodel/test/cases/serializers/json_serialization_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activemodel/test/cases/serializers/json_serialization_test.rb b/activemodel/test/cases/serializers/json_serialization_test.rb
index f0347081ee..8eb7a58e90 100644
--- a/activemodel/test/cases/serializers/json_serialization_test.rb
+++ b/activemodel/test/cases/serializers/json_serialization_test.rb
@@ -158,7 +158,13 @@ class JsonSerializationTest < ActiveModel::TestCase
test "as_json should keep the default order in the hash" do
json = @contact.as_json
- assert_equal %w(name age created_at awesome preferences), json.keys
+ attributes_order = %w(name age created_at awesome preferences)
+ #Order on JRUBY is different
+ if defined? JRUBY_VERSION
+ attributes_order = %w(age name created_at awesome preferences)
+ end
+
+ assert_equal attributes_order, json.keys
end
test "from_json should work without a root (class attribute)" do