mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #41467 from fredplante/improve-rack-test-integration
Improve rack_test integration for system tests
This commit is contained in:
commit
983a50da87
2 changed files with 6 additions and 5 deletions
|
@ -24,7 +24,7 @@ module ActionDispatch
|
|||
|
||||
private
|
||||
def registerable?
|
||||
[:selenium, :poltergeist, :webkit].include?(@name)
|
||||
[:selenium, :poltergeist, :webkit, :rack_test].include?(@name)
|
||||
end
|
||||
|
||||
def register
|
||||
|
@ -35,6 +35,7 @@ module ActionDispatch
|
|||
when :selenium then register_selenium(app)
|
||||
when :poltergeist then register_poltergeist(app)
|
||||
when :webkit then register_webkit(app)
|
||||
when :rack_test then register_rack_test(app)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -59,6 +60,10 @@ module ActionDispatch
|
|||
end
|
||||
end
|
||||
|
||||
def register_rack_test(app)
|
||||
Capybara::RackTest::Driver.new(app, { respect_data_method: true }.merge(@options))
|
||||
end
|
||||
|
||||
def setup
|
||||
Capybara.current_driver = @name
|
||||
end
|
||||
|
|
|
@ -51,10 +51,6 @@ class DriverTest < ActiveSupport::TestCase
|
|||
assert_equal ({ skip_image_loading: true }), driver.instance_variable_get(:@options)
|
||||
end
|
||||
|
||||
test "registerable? returns false if driver is rack_test" do
|
||||
assert_not ActionDispatch::SystemTesting::Driver.new(:rack_test).send(:registerable?)
|
||||
end
|
||||
|
||||
test "define extra capabilities using chrome" do
|
||||
driver = ActionDispatch::SystemTesting::Driver.new(:selenium, screen_size: [1400, 1400], using: :chrome) do |option|
|
||||
option.add_argument("start-maximized")
|
||||
|
|
Loading…
Reference in a new issue