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

@@ -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