rewrite test with "expect to change" syntax

Co-authored-by: mfo <mfo@users.noreply.github.com>
This commit is contained in:
Mathieu Magnin 2024-09-06 14:10:22 +02:00 committed by Mathieu Magnin
parent 9e843a3df4
commit ced80bf23d
No known key found for this signature in database
GPG key ID: 8DCAFC82D7BA654E

View file

@ -40,17 +40,16 @@ describe Users::PasswordsController, type: :controller do
end
it "marks user's email as verified" do
expect(user.email_verified_at).to be_nil
put :update, params: {
user: {
reset_password_token: @token,
password: "mot de passe super secret",
password_confirmation: "mot de passe super secret"
expect do
put :update, params: {
user: {
reset_password_token: @token,
password: "mot de passe super secret",
password_confirmation: "mot de passe super secret"
}
}
}
expect(user.reload.email_verified_at).to be_present
end.to change { user.reload.email_verified_at }
.from(nil).to(anything)
end
end
end