Skip to content

Add example of expect(response).to have_http_status(:status_code_name) #10

@eliotsykes

Description

@eliotsykes

Example of using have_http_status method

# Rails `:symbolized` status codes at end of each status code page at http://httpstatus.es/
expect(response).to have_http_status(:success) # 200
expect(response).to have_http_status(:forbidden) # 403

Source: RSpec Controller Specs cheatsheet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions