Merge pull request #1119 from Br3nda/bw/ParenthesesAsGroupedExpression

Fixed parentheses that are interp-ed as grouped expression
This commit is contained in:
Daniel O'Connor
2016-12-07 12:30:38 +10:30
committed by GitHub
6 changed files with 10 additions and 17 deletions

View File

@@ -26,15 +26,6 @@ Lint/HandleExceptions:
Exclude:
- 'lib/tasks/testing.rake'
# Offense count: 8
Lint/ParenthesesAsGroupedExpression:
Exclude:
- 'app/mailers/notifier.rb'
- 'spec/features/harvests/browse_harvests_spec.rb'
- 'spec/models/follow_spec.rb'
- 'spec/models/member_spec.rb'
- 'spec/views/plantings/show.html.haml_spec.rb'
# Offense count: 15
# Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.

View File

@@ -16,7 +16,8 @@ class Notifier < ActionMailer::Base
@reply_link = reply_link(@notification)
# Encrypting
@signed_message = verifier.generate ({ member_id: @notification.recipient.id, type: :send_notification_email })
message = { member_id: @notification.recipient.id, type: :send_notification_email }
@signed_message = verifier.generate(message)
mail(to: @notification.recipient.email,
subject: @notification.subject)
@@ -29,7 +30,8 @@ class Notifier < ActionMailer::Base
@harvests = @member.harvests.first(5)
# Encrypting
@signed_message = verifier.generate ({ member_id: @member.id, type: :send_planting_reminder })
message = { member_id: @member.id, type: :send_planting_reminder }
@signed_message = verifier.generate(message)
if @member.send_planting_reminder
mail(to: @member.email,

View File

@@ -11,7 +11,7 @@ feature "browse harvests" do
feature 'blank optional fields' do
let!(:harvest) { create :harvest, :no_description }
before (:each) do
before(:each) do
visit harvests_path
end
@@ -23,7 +23,7 @@ feature "browse harvests" do
feature "filled in optional fields" do
let!(:harvest) { create :harvest, :long_description }
before (:each) do
before(:each) do
visit harvests_path
end

View File

@@ -20,7 +20,7 @@ describe Follow do
end
context "when follow is created" do
before (:each) do
before(:each) do
@follow = Follow.create(follower_id: @member1.id, followed_id: @member2.id)
end

View File

@@ -354,11 +354,11 @@ describe 'member' do
member.update_account_after_purchase(product)
# stringify to avoid millisecond problems...
member.account.paid_until.to_s.should eq (Time.zone.now + 3.months).to_s
member.account.paid_until.to_s.should eq((Time.zone.now + 3.months).to_s)
# and again to make sure it works for currently paid accounts
member.update_account_after_purchase(product)
member.account.paid_until.to_s.should eq (Time.zone.now + 3.months + 3.months).to_s
member.account.paid_until.to_s.should eq((Time.zone.now + 3.months + 3.months).to_s)
end
end

View File

@@ -22,7 +22,7 @@ describe "plantings/show" do
)
end
before (:each) do
before(:each) do
@member = FactoryGirl.create(:member)
controller.stub(:current_user) { @member }
@p = create_planting_for(@member)