Fix deprecations

This commit is contained in:
Daniel O'Connor committed 2022-11-08 00:30:44 +10:30
1 parent b726f40d9b
commit 96147809ee
1 file changed
+5 -5
+5 -5
View File
@@ -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