diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-16 04:30:11 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-16 04:30:11 -0300 |
commit | 55f9b8129a50206513264824abb44088230793c2 (patch) | |
tree | ff2f01cabfc7e74b0bd831c2272a5517e4e81e99 /activerecord/test/cases/nested_attributes_with_callbacks_test.rb | |
parent | d0bdd74d7f6fae3d69b3681d5bc2d5ef6f55a0f8 (diff) | |
download | rails-55f9b8129a50206513264824abb44088230793c2.tar.gz rails-55f9b8129a50206513264824abb44088230793c2.tar.bz2 rails-55f9b8129a50206513264824abb44088230793c2.zip |
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
Diffstat (limited to 'activerecord/test/cases/nested_attributes_with_callbacks_test.rb')
-rw-r--r-- | activerecord/test/cases/nested_attributes_with_callbacks_test.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/cases/nested_attributes_with_callbacks_test.rb b/activerecord/test/cases/nested_attributes_with_callbacks_test.rb index d606a6c12d..8954e8c7e3 100644 --- a/activerecord/test/cases/nested_attributes_with_callbacks_test.rb +++ b/activerecord/test/cases/nested_attributes_with_callbacks_test.rb @@ -21,7 +21,7 @@ class NestedAttributesWithCallbacksTest < ActiveRecord::TestCase @@add_callback_called = [] @pirate = Pirate.new.tap do |pirate| pirate.catchphrase = "Don't call me!" - pirate.birds_attributes = [{name: "Bird1"},{name: "Bird2"}] + pirate.birds_attributes = [{ name: "Bird1" },{ name: "Bird2" }] pirate.save! end @birds = @pirate.birds.to_a @@ -46,17 +46,17 @@ class NestedAttributesWithCallbacksTest < ActiveRecord::TestCase end def new_bird_attributes - [{"name" => "New Bird"}] + [{ "name" => "New Bird" }] end def destroy_bird_attributes - [{"id" => bird_to_destroy.id.to_s, "_destroy" => true}] + [{ "id" => bird_to_destroy.id.to_s, "_destroy" => true }] end def update_new_and_destroy_bird_attributes - [{"id" => @birds[0].id.to_s, "name" => "New Name"}, - {"name" => "New Bird"}, - {"id" => bird_to_destroy.id.to_s, "_destroy" => true}] + [{ "id" => @birds[0].id.to_s, "name" => "New Name" }, + { "name" => "New Bird" }, + { "id" => bird_to_destroy.id.to_s, "_destroy" => true }] end # Characterizing when :before_add callback is called @@ -136,9 +136,9 @@ class NestedAttributesWithCallbacksTest < ActiveRecord::TestCase def assert_assignment_affects_records_in_target(association_name) association = @pirate.send(association_name) - assert association.detect {|b| b == bird_to_update }.name_changed?, + assert association.detect { |b| b == bird_to_update }.name_changed?, "Update record not updated" - assert association.detect {|b| b == bird_to_destroy }.marked_for_destruction?, + assert association.detect { |b| b == bird_to_destroy }.marked_for_destruction?, "Destroy record not marked for destruction" end end |