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

@ -29,7 +29,7 @@ describe BackupRestore::Backuper do
expect { backuper.send(:notify_user) }
.to change { Topic.private_messages.count }.by(1)
.and change { Upload.count }.by(0)
.and not_change { Upload.count }
end
expect(Topic.last.first_post.raw).to include("```text\n[2010-01-01 12:00:00] Notifying 'system' of the end of the backup...\n```")
@ -63,7 +63,7 @@ describe BackupRestore::Backuper do
expect { backuper.send(:notify_user) }
.to change { Topic.private_messages.count }.by(1)
.and change { Upload.count }.by(0)
.and not_change { Upload.count }
end
expect(Topic.last.first_post.raw).to include("```text\n...\n[2010-01-01 12:00:00] Line 10\n[2010-01-01 12:00:00] Notifying 'system' of the end of the backup...\n```")