Skip to content

Use `sign_in` instead of `login_as` when we're not testing login flow

Robert Speicher requested to merge rs-sign-in-poc into master

This is a proof of concept for #30196 (closed).

The actual login procedure is well-tested by spec/features/login_spec.rb, and we don't gain anything by also thoroughly testing it here, in our second-slowest feature spec. In fact, it only slows us down!

So instead we use sign_in from the Devise::Test::IntegrationHelpers module, which just sets the current user at the Warden level. This drastically reduces the "setup" phase of every test in this file. A non-scientific test run saw this drop from 633 to 231 seconds.

Merge request reports