Auto corrected by following Style/Lambda

This commit is contained in:
Awesome Code
2018-01-13 22:50:22 +00:00
committed by Shiny
parent 92e56cfc1e
commit e8d9314cff
2 changed files with 7 additions and 7 deletions

View File

@@ -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

View File

@@ -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