File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -714,10 +714,12 @@ class JbuilderTest < ActiveSupport::TestCase
714
714
end
715
715
end
716
716
717
- test "respects JSON encoding customizations" do
718
- # Active Support overrides Time#as_json for custom formatting.
719
- # Ensure we call #to_json on the final attributes instead of JSON.dump.
720
- result = JSON . load ( Jbuilder . new { |json | json . time Time . parse ( "2018-05-13 11:51:00.485 -0400" ) } . target! )
721
- assert_equal "2018-05-13T11:51:00.485-04:00" , result [ "time" ]
717
+ if RUBY_VERSION >= "2.2.10"
718
+ test "respects JSON encoding customizations" do
719
+ # Active Support overrides Time#as_json for custom formatting.
720
+ # Ensure we call #to_json on the final attributes instead of JSON.dump.
721
+ result = JSON . load ( Jbuilder . encode { |json | json . time Time . parse ( "2018-05-13 11:51:00.485 -0400" ) } )
722
+ assert_equal "2018-05-13T11:51:00.485-04:00" , result [ "time" ]
723
+ end
722
724
end
723
725
end
You can’t perform that action at this time.
0 commit comments