Skip to main content
100%

Gist 189415

✓ Published0🌍 Public
XXXX
Last edited Sep 19, 2009
Created on Sep 19, 2009

This example shows a Ruby on Rails controller test that verifies a user can be created via a POST request. It uses RSpec’s `describe`, `before`, and `it` blocks to set up a User instance, delete its `id` attribute, and then assert that the `POST` to the `:users` resource changes the User count by one and returns a successful response. The code relies on the `request` helper and `lambda` to wrap the API call, checking both the database change and the HTTP status.

AI-generated description

Similar vizzes