Skip to content

Commit 76aa680

Browse files
committed
fix: update user registration spec to handle invalid person attributes correctly
1 parent 8389618 commit 76aa680

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spec/requests/better_together/users/registrations_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@
8787
privacy_policy_agreement: '1',
8888
code_of_conduct_agreement: '1'
8989
}
90-
end.to change(BetterTogether::User, :count).by(1) # User created despite empty name
90+
end.not_to change(BetterTogether::User, :count) # User not created due to invalid person
9191

92-
expect(response).to have_http_status(:ok) # Form re-rendered with errors
92+
expect(response).to have_http_status(:unprocessable_content) # Validation failed
93+
expect(response.body).to include('can't be blank') # Name validation error shown
9394
end
9495
end
9596

0 commit comments

Comments
 (0)