Skip to content

Commit 7797681

Browse files
committed
Simplify the logic in the documentation.
1 parent 461ee94 commit 7797681

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

guides/source/testing.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,10 +891,12 @@ you have to add remote `url` and set `browser` as remote through `options`.
891891
require "test_helper"
892892
893893
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
894-
options = {
895-
browser: ENV["SELENIUM_REMOTE_URL"].blank? ? :chrome : :remote,
896-
url: ENV["SELENIUM_REMOTE_URL"].blank? ? nil : ENV["SELENIUM_REMOTE_URL"]
897-
}
894+
url = ENV.fetch("SELENIUM_REMOTE_URL", nil)
895+
options = if url
896+
{ browser: :remote, url }
897+
else
898+
{ browser: :chrome }
899+
end
898900
driven_by :selenium, using: :headless_chrome, options: options
899901
end
900902
```

0 commit comments

Comments
 (0)