From 5f97b87f3c94dc7e2cdd049299bf11c78a0cc63a Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 6 Nov 2022 15:23:05 +0100 Subject: [PATCH] Fix rubocop offenses --- db/migrate/20221106130744_add_inbox_locked_to_users.rb | 2 ++ spec/workers/question_worker_spec.rb | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/db/migrate/20221106130744_add_inbox_locked_to_users.rb b/db/migrate/20221106130744_add_inbox_locked_to_users.rb index e063ad2d..295ebca7 100644 --- a/db/migrate/20221106130744_add_inbox_locked_to_users.rb +++ b/db/migrate/20221106130744_add_inbox_locked_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddInboxLockedToUsers < ActiveRecord::Migration[6.1] def up add_column :users, :privacy_lock_inbox, :boolean, default: false diff --git a/spec/workers/question_worker_spec.rb b/spec/workers/question_worker_spec.rb index 6753f619..de116e73 100644 --- a/spec/workers/question_worker_spec.rb +++ b/spec/workers/question_worker_spec.rb @@ -6,7 +6,7 @@ describe QuestionWorker do describe "#perform" do let(:user) { FactoryBot.create(:user) } let(:user_id) { user.id } - let(:question) { FactoryBot.create(:question, user: user) } + let(:question) { FactoryBot.create(:question, user:) } let(:question_id) { question.id } before do @@ -21,7 +21,7 @@ describe QuestionWorker do it "places the question in the inbox of the user's followers" do expect { subject } .to( - change { Inbox.where(user_id: user.followers.ids, question_id: question_id, new: true).count } + change { Inbox.where(user_id: user.followers.ids, question_id:, new: true).count } .from(0) .to(5) ) @@ -35,7 +35,7 @@ describe QuestionWorker do expect { subject } .to( - change { Inbox.where(user_id: user.followers.ids, question_id: question_id, new: true).count } + change { Inbox.where(user_id: user.followers.ids, question_id:, new: true).count } .from(0) .to(4) ) @@ -46,7 +46,7 @@ describe QuestionWorker do expect { subject } .to( - change { Inbox.where(user_id: user.followers.ids, question_id: question_id, new: true).count } + change { Inbox.where(user_id: user.followers.ids, question_id:, new: true).count } .from(0) .to(4) )