Add test for sending questions to banned users

This commit is contained in:
Karina Kwiatek 2022-11-12 12:13:51 +01:00
parent 68ca431165
commit 0b67baa3c4
1 changed files with 11 additions and 0 deletions

View File

@ -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