mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-24 09:43:24 -04:00
Auto corrected by following Style/Lambda
This commit is contained in:
@@ -44,12 +44,12 @@ describe MembersController do
|
||||
end
|
||||
|
||||
it "doesn't show completely nonsense members" do
|
||||
lambda { get :show, id: 9999 }.should raise_error(ActiveRecord::RecordNotFound)
|
||||
-> { get :show, id: 9999 }.should raise_error(ActiveRecord::RecordNotFound)
|
||||
end
|
||||
|
||||
it "doesn't show unconfirmed members" do
|
||||
@member2 = FactoryBot.create(:unconfirmed_member)
|
||||
lambda { get :show, id: @member2.id }.should raise_error(ActiveRecord::RecordNotFound)
|
||||
-> { get :show, id: @member2.id }.should raise_error(ActiveRecord::RecordNotFound)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ describe Photo do
|
||||
|
||||
it "automatically if unused" do
|
||||
photo.destroy_if_unused
|
||||
expect(lambda { 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
|
||||
@@ -58,7 +58,7 @@ describe Photo do
|
||||
planting.photos << photo
|
||||
harvest.destroy # photo is now used by harvest but not planting
|
||||
photo.destroy_if_unused
|
||||
expect(lambda { photo.reload }).not_to raise_error
|
||||
expect(-> { photo.reload }).not_to raise_error
|
||||
end
|
||||
|
||||
it 'they are used by harvests but not plantings' do
|
||||
@@ -66,7 +66,7 @@ describe Photo do
|
||||
planting.photos << photo
|
||||
planting.destroy # photo is now used by harvest but not planting
|
||||
photo.destroy_if_unused
|
||||
expect(lambda { photo.reload }).not_to raise_error
|
||||
expect(-> { photo.reload }).not_to raise_error
|
||||
end
|
||||
|
||||
it 'they are used by gardens but not plantings' do
|
||||
@@ -74,7 +74,7 @@ describe Photo do
|
||||
planting.photos << photo
|
||||
planting.destroy # photo is now used by garden but not planting
|
||||
photo.destroy_if_unused
|
||||
expect(lambda { photo.reload }).not_to raise_error
|
||||
expect(-> { photo.reload }).not_to raise_error
|
||||
end
|
||||
|
||||
it 'they are no longer used by anything' do
|
||||
@@ -99,7 +99,7 @@ describe Photo do
|
||||
expect(photo.harvests.size).to eq 0
|
||||
expect(photo.gardens.size).to eq 0
|
||||
photo.destroy_if_unused
|
||||
expect(lambda { 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
|
||||
|
||||
Reference in New Issue
Block a user