mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove the use of Capybara::Session#quit (#24978)
Why this change?
This is what `Capybara::Session#quit` does:
```
def quit
@driver.quit if @driver.respond_to? :quit
@document = @driver = nil
@touched = false
@server&.reset_error!
end
```
One notable thing is that it resets server errors which means that any
server errors encountered by a session is cleared. That is not what we
want since it hides errors even though `Capybara.raise_server_errors`
has been set to `true`.
This commit is contained in:
committed by
GitHub
parent
043fa28fab
commit
68a3f7783e
@@ -148,10 +148,9 @@ module SystemHelpers
|
||||
end
|
||||
|
||||
def using_browser_timezone(timezone, &example)
|
||||
using_session(timezone) do |session|
|
||||
using_session(timezone) do
|
||||
page.driver.browser.devtools.emulation.set_timezone_override(timezone_id: timezone)
|
||||
freeze_time(&example)
|
||||
session.quit
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user