PhoenixSwagger.SchemaTest.validate_resp_schema
You're seeing just the function
validate_resp_schema
, go back to PhoenixSwagger.SchemaTest module for more information.
Validates a response body against a swagger schema.
Example
use MyApp.ConnCase
use PhoenixSwagger.SchemaTest "priv/static/swagger.json"
test "get user by ID", %{conn: conn, swagger_schema: schema} do
response =
conn
|> get(user_path(conn, :show, 123))
|> validate_resp_schema(schema, "User")
|> json_response(200)
assert response["data"]["id"] == 123
end