From 0b67baa3c48cc786e49fae6822d0931ec0fdf24f Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sat, 12 Nov 2022 12:13:51 +0100 Subject: [PATCH] Add test for sending questions to banned users --- spec/workers/question_worker_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/workers/question_worker_spec.rb b/spec/workers/question_worker_spec.rb index 94f45a50..c427058b 100644 --- a/spec/workers/question_worker_spec.rb +++ b/spec/workers/question_worker_spec.rb @@ -40,5 +40,16 @@ describe QuestionWorker do .to(4) ) end + + it "does not send questions to banned users" do + user.followers.first.ban + + expect { subject } + .to( + change { Inbox.where(user_id: user.followers.ids, question_id: question_id, new: true).count } + .from(0) + .to(4) + ) + end end end