From 96147809eea43c7a7ca84c80dde3d8f8c4fd596c Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 8 Nov 2022 00:30:44 +1030 Subject: [PATCH] Fix deprecations --- spec/models/photo_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 3b258e7d0..a9b54c236 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -103,7 +103,7 @@ describe Photo do it "automatically if unused" do photo.destroy_if_unused - expect(-> { photo.reload }).to raise_error ActiveRecord::RecordNotFound + expect { photo.reload }.to raise_error ActiveRecord::RecordNotFound end it 'they are used by plantings but not harvests' do @@ -111,7 +111,7 @@ describe Photo do planting.photos << photo harvest.destroy # photo is now used by harvest but not planting photo.destroy_if_unused - expect(-> { photo.reload }).not_to raise_error + expect{ photo.reload }.not_to raise_error end it 'they are used by harvests but not plantings' do @@ -119,7 +119,7 @@ describe Photo do planting.photos << photo planting.destroy # photo is now used by harvest but not planting photo.destroy_if_unused - expect(-> { photo.reload }).not_to raise_error + expect { photo.reload }.not_to raise_error end it 'they are used by gardens but not plantings' do @@ -127,7 +127,7 @@ describe Photo do planting.photos << photo planting.destroy # photo is now used by garden but not planting photo.destroy_if_unused - expect(-> { photo.reload }).not_to raise_error + expect { photo.reload }.not_to raise_error end it 'they are no longer used by anything' do @@ -152,7 +152,7 @@ describe Photo do expect(photo.harvests.count).to eq 0 expect(photo.gardens.count).to eq 0 photo.destroy_if_unused - expect(-> { photo.reload }).to raise_error ActiveRecord::RecordNotFound + expect { photo.reload }.to raise_error ActiveRecord::RecordNotFound end it 'does not occur when a photo is still in use' do