From e8d9314cff281c112e8e3d23e920f4a36bd0e4cc Mon Sep 17 00:00:00 2001 From: Awesome Code Date: Sat, 13 Jan 2018 22:50:22 +0000 Subject: [PATCH] Auto corrected by following Style/Lambda --- spec/controllers/member_controller_spec.rb | 4 ++-- spec/models/photo_spec.rb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/controllers/member_controller_spec.rb b/spec/controllers/member_controller_spec.rb index b04bcd799..14ba85e08 100644 --- a/spec/controllers/member_controller_spec.rb +++ b/spec/controllers/member_controller_spec.rb @@ -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 diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index c971ce2fd..5f07a3e29 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -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