Skip to content

Backend Pattern Test Controller

Ferris Tseng edited this page Jan 2, 2020 · 3 revisions

[Pattern] Test - Controller

Description

Tests a controller.

Location

  • spec/controllers

Best Practices

To avoid creating a new user, most controller specs that only require a user to be authenticated, but isn’t specifically testing authentication, we should be using:

allow(controller).to receive(:verify_authentication).and_return(true)

as opposed to User.authenticate!.

Resources

Examples in Caseflow

Additional Reading

Related Patterns

Pattern Description
Clone this wiki locally