mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Don’t use change { … }.by(0) in specs
This commit is contained in:
committed by
Loïc Guitaut
parent
3bfc254c4e
commit
91b6b5eee7
@@ -26,8 +26,8 @@ describe ImportExport::Importer do
|
||||
|
||||
expect {
|
||||
import(data)
|
||||
}.to change { Category.count }.by(0)
|
||||
.and change { Group.count }.by(0)
|
||||
}.to not_change { Category.count }
|
||||
.and not_change { Group.count }
|
||||
.and change { Topic.count }.by(2)
|
||||
.and change { User.count }.by(2)
|
||||
end
|
||||
@@ -43,7 +43,7 @@ describe ImportExport::Importer do
|
||||
}.to change { Category.count }.by(6)
|
||||
.and change { Group.count }.by(2)
|
||||
.and change { Topic.count }.by(6)
|
||||
.and change { User.count }.by(0)
|
||||
.and not_change { User.count }
|
||||
end
|
||||
|
||||
it 'works with sub-sub-categories' do
|
||||
@@ -91,10 +91,10 @@ describe ImportExport::Importer do
|
||||
|
||||
expect {
|
||||
import(data)
|
||||
}.to change { Category.count }.by(0)
|
||||
}.to not_change { Category.count }
|
||||
.and change { Group.count }.by(2)
|
||||
.and change { Topic.count }.by(0)
|
||||
.and change { User.count }.by(0)
|
||||
.and not_change { Topic.count }
|
||||
.and not_change { User.count }
|
||||
end
|
||||
|
||||
it 'all' do
|
||||
|
||||
Reference in New Issue
Block a user