diff options
author | George Claghorn <george@basecamp.com> | 2018-07-17 16:23:53 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-07-17 16:23:53 -0400 |
commit | af02b9b78f7b735345a891222532d32caf871520 (patch) | |
tree | d5ac0b4783e389621db93b62a8c7e84b40c93214 | |
parent | e13e16f5adf3221f4a95e7d105efb2d5e56c0b53 (diff) | |
download | rails-af02b9b78f7b735345a891222532d32caf871520.tar.gz rails-af02b9b78f7b735345a891222532d32caf871520.tar.bz2 rails-af02b9b78f7b735345a891222532d32caf871520.zip |
Remove unnecessary tap
-rw-r--r-- | activestorage/test/models/attached/many_test.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/activestorage/test/models/attached/many_test.rb b/activestorage/test/models/attached/many_test.rb index 24974a78a6..82be88af08 100644 --- a/activestorage/test/models/attached/many_test.rb +++ b/activestorage/test/models/attached/many_test.rb @@ -170,19 +170,17 @@ class ActiveStorage::ManyAttachedTest < ActiveSupport::TestCase end test "replacing existing, independent attachments on an existing record via assign and attach" do - [ create_blob(filename: "funky.mp4"), create_blob(filename: "town.mp4") ].tap do |old_blobs| - @user.vlogs.attach old_blobs - - @user.vlogs = [] - assert_not @user.vlogs.attached? + @user.vlogs.attach create_blob(filename: "funky.mp4"), create_blob(filename: "town.mp4") - assert_no_enqueued_jobs only: ActiveStorage::PurgeJob do - @user.vlogs.attach create_blob(filename: "whenever.mp4"), create_blob(filename: "wherever.mp4") - end + @user.vlogs = [] + assert_not @user.vlogs.attached? - assert_equal "whenever.mp4", @user.vlogs.first.filename.to_s - assert_equal "wherever.mp4", @user.vlogs.second.filename.to_s + assert_no_enqueued_jobs only: ActiveStorage::PurgeJob do + @user.vlogs.attach create_blob(filename: "whenever.mp4"), create_blob(filename: "wherever.mp4") end + + assert_equal "whenever.mp4", @user.vlogs.first.filename.to_s + assert_equal "wherever.mp4", @user.vlogs.second.filename.to_s end test "successfully updating an existing record to replace existing, dependent attachments" do |