Backend Pattern Test Controller - department-of-veterans-affairs/caseflow GitHub Wiki

[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
⚠️ **GitHub.com Fallback** ⚠️