From aace7aea02bb9266f99f8da4f692c6137ac25877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 10 Oct 2019 02:46:46 +0200 Subject: [PATCH] Apply Layout/SpaceAroundOperators rubocop rule We were a bit inconsistent when aligning equal signs vertically. --- lib/score_calculator.rb | 2 +- spec/features/notifications_spec.rb | 1 + spec/models/newsletter_spec.rb | 1 + spec/models/proposal_spec.rb | 8 ++++---- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/score_calculator.rb b/lib/score_calculator.rb index 52a5c0116..2ca6e3eda 100644 --- a/lib/score_calculator.rb +++ b/lib/score_calculator.rb @@ -6,7 +6,7 @@ module ScoreCalculator period = [1, [max_period, resource_age(resource)].min].max votes_total = resource.votes_for.where("created_at >= ?", period.days.ago).count - votes_up = resource.get_upvotes.where("created_at >= ?", period.days.ago).count + votes_up = resource.get_upvotes.where("created_at >= ?", period.days.ago).count votes_down = votes_total - votes_up votes_score = votes_up - votes_down diff --git a/spec/features/notifications_spec.rb b/spec/features/notifications_spec.rb index 1b92ca794..3a3ce8ac1 100644 --- a/spec/features/notifications_spec.rb +++ b/spec/features/notifications_spec.rb @@ -217,6 +217,7 @@ describe "Notifications" do Notification.send_pending now = Notification.first_batch_run_at + first_batch_run_at = now.change(usec: 0) second_batch_run_at = (now + 1.second).change(usec: 0) third_batch_run_at = (now + 2.seconds).change(usec: 0) diff --git a/spec/models/newsletter_spec.rb b/spec/models/newsletter_spec.rb index fe8867d74..d04f7e8d0 100644 --- a/spec/models/newsletter_spec.rb +++ b/spec/models/newsletter_spec.rb @@ -100,6 +100,7 @@ describe Newsletter do newsletter.deliver now = newsletter.first_batch_run_at + first_batch_run_at = now.change(usec: 0) second_batch_run_at = (now + 1.second).change(usec: 0) third_batch_run_at = (now + 2.seconds).change(usec: 0) diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index baa89c32b..625ef2fc5 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -607,11 +607,11 @@ describe Proposal do end it "orders by weight and then by votes" do - title_some_votes = create(:proposal, title: "stop corruption", cached_votes_up: 5) - title_least_voted = create(:proposal, title: "stop corruption", cached_votes_up: 2) - title_most_voted = create(:proposal, title: "stop corruption", cached_votes_up: 10) + title_some_votes = create(:proposal, title: "stop corruption", cached_votes_up: 5) + title_least_voted = create(:proposal, title: "stop corruption", cached_votes_up: 2) + title_most_voted = create(:proposal, title: "stop corruption", cached_votes_up: 10) - summary_most_voted = create(:proposal, summary: "stop corruption", cached_votes_up: 10) + summary_most_voted = create(:proposal, summary: "stop corruption", cached_votes_up: 10) results = Proposal.search("stop corruption")