mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Improve performance of system test sign_in helper (#19579)
Previously, calling `sign_in` would cause the browser to be redirected to `/`, and would cause the Ember app to boot. We would then call `visit()`, causing the app to boot for a second time. This commit adds a `redirect=false` option to the `/session/username/become` route. This avoids the unnecessary boot of the app, and leads to significantly faster system spec run times. In local testing, this takes the full system-spec suite for chat from ~6min to ~4min.
This commit is contained in:
@@ -12,7 +12,7 @@ module SystemHelpers
|
||||
end
|
||||
|
||||
def sign_in(user)
|
||||
visit "/session/#{user.encoded_username}/become"
|
||||
visit "/session/#{user.encoded_username}/become.json?redirect=false"
|
||||
end
|
||||
|
||||
def sign_out
|
||||
|
||||
Reference in New Issue
Block a user