mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 00:00:46 +08:00
DEV: Don’t use change { … }.by(0)
in specs
This commit is contained in:

committed by
Loïc Guitaut

parent
3bfc254c4e
commit
91b6b5eee7
@ -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```")
|
||||
|
Reference in New Issue
Block a user