Investigate bypassing the login procedure for most feature specs
Most feature specs depend on a user being authenticated, and most of them handle it by calling our helper method login_as
, which calls login_with
, which actually loads the sign in page, fills in the form, and clicks submit. Because we redirect to the dashboard after a successful sign-in, that's two full request cycles every time a test needs an authenticated user. We probably do that hundreds of times across the suite. The cost gets even higher when that test is using the JavaScript driver.
This is testing too much. We've got an entire feature test dedicated to testing logins; we should consider this area well-tested and allow ourselves to bypass this full login procedure everywhere else.
Basically I want to replace almost every login_as
call with something like set_current_user
which just authenticates the user at the lowest-possible level, probably through Warden.
cc @rymai