Add and apply RSpec/ReceiveMessages rubocop rule

This rule was added in rubocop-rspec 2.23.0. I didn't know this method
existed, and it makes the code more readable in some cases.
This commit is contained in:
Javi Martín
2023-09-08 13:26:15 +02:00
parent 9bb2bfdd06
commit 1d5f03be8c
10 changed files with 30 additions and 39 deletions

View File

@@ -213,9 +213,11 @@ describe "Notifications" do
end
it "sends batches in time intervals" do
allow(Notification).to receive(:batch_size).and_return(1)
allow(Notification).to receive(:batch_interval).and_return(1.second)
allow(Notification).to receive(:first_batch_run_at).and_return(Time.current)
allow(Notification).to receive_messages(
batch_size: 1,
batch_interval: 1.second,
first_batch_run_at: Time.current
)
remove_users_without_pending_notifications