diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:38:23 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:38:23 +0200 |
commit | 4c208254573c3428d82bd8744860bd86e1c78acb (patch) | |
tree | 9c8194acb75552fdda62d527d5c2876da9161650 /activemodel/test/cases/serializers | |
parent | 18a2513729ab90b04b1c86963e7d5b9213270c81 (diff) | |
download | rails-4c208254573c3428d82bd8744860bd86e1c78acb.tar.gz rails-4c208254573c3428d82bd8744860bd86e1c78acb.tar.bz2 rails-4c208254573c3428d82bd8744860bd86e1c78acb.zip |
applies new string literal convention in activemodel/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
Diffstat (limited to 'activemodel/test/cases/serializers')
-rw-r--r-- | activemodel/test/cases/serializers/json_serialization_test.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/activemodel/test/cases/serializers/json_serialization_test.rb b/activemodel/test/cases/serializers/json_serialization_test.rb index d765a47636..45c166f33a 100644 --- a/activemodel/test/cases/serializers/json_serialization_test.rb +++ b/activemodel/test/cases/serializers/json_serialization_test.rb @@ -1,15 +1,15 @@ -require 'cases/helper' -require 'models/contact' -require 'active_support/core_ext/object/instance_variables' +require "cases/helper" +require "models/contact" +require "active_support/core_ext/object/instance_variables" class JsonSerializationTest < ActiveModel::TestCase def setup @contact = Contact.new - @contact.name = 'Konata Izumi' + @contact.name = "Konata Izumi" @contact.age = 16 @contact.created_at = Time.utc(2006, 8, 1) @contact.awesome = true - @contact.preferences = { 'shows' => 'anime' } + @contact.preferences = { "shows" => "anime" } end test "should not include root in json (class method)" do @@ -53,7 +53,7 @@ class JsonSerializationTest < ActiveModel::TestCase end test "should include custom root in json" do - json = @contact.to_json(root: 'json_contact') + json = @contact.to_json(root: "json_contact") assert_match %r{^\{"json_contact":\{}, json assert_match %r{"name":"Konata Izumi"}, json @@ -134,9 +134,9 @@ class JsonSerializationTest < ActiveModel::TestCase json = @contact.as_json assert_kind_of Hash, json - assert_kind_of Hash, json['contact'] + assert_kind_of Hash, json["contact"] %w(name age created_at awesome preferences).each do |field| - assert_equal @contact.send(field), json['contact'][field] + assert_equal @contact.send(field), json["contact"][field] end ensure Contact.include_root_in_json = original_include_root_in_json |