DEV: Don’t use change { … }.by(0) in specs

This commit is contained in:
Loïc Guitaut
2022-07-19 16:03:03 +02:00
committed by Loïc Guitaut
parent 3bfc254c4e
commit 91b6b5eee7
44 changed files with 138 additions and 136 deletions

View File

@ -490,7 +490,7 @@ describe DiscourseNarrativeBot::TrackSelector do
post.update!(raw: 'thanks @discobot!')
expect { described_class.new(:reply, user, post_id: post.id).select }
.to change { PostAction.count }.by(0)
.not_to change { PostAction.count }
new_post = Post.last
expect(new_post.raw).to eq(random_mention_reply)

View File

@ -121,7 +121,7 @@ describe User do
expect {
user.user_option.save!
}.to change { Topic.count }.by(-1)
.and change { UserHistory.count }.by(0)
.and not_change { UserHistory.count }
.and change { user.unread_high_priority_notifications }.by(-1)
.and change { user.notifications.count }.by(-1)
end