Disable RSpec/ChangeByZero to fix spec

The and chaining doesn't work with no change assumptions
This commit is contained in:
Oliver Günther
2025-10-16 14:19:14 +02:00
parent 3473394130
commit 8195341402
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -279,6 +279,11 @@ RSpec/LeadingSubject:
RSpec/NamedSubject:
Enabled: false
# expect not_to change is not working as expected
# if you chain it with multiple expected changes
RSpec/ChangeByZero:
Enabled: false
RSpec/ContextWording:
Prefixes:
- and
+2 -2
View File
@@ -290,8 +290,8 @@ RSpec.describe MembersController do
it "adds the existing user as a member instead of creating a new invitation" do
expect { post :create, params: }
.to not_change(User, :count).by(0)
.and change(Member, :count).by(1)
.to change(Member, :count).by(1)
.and change(User, :count).by(0)
expect(response).to redirect_to "/projects/pet_project/members?status=all"