Make driven_by
overridable
#28586
Merged
Make driven_by
overridable
#28586
Conversation
r? @eileencodes (@rails-bot has picked a reviewer for you, use r? to override) |
actionpack/test/dispatch/system_testing/system_test_case_test.rb
Outdated
@@ -6,6 +6,14 @@ class SetDriverToRackTestTest < DrivenByRackTest | |||
end | |||
end | |||
|
|||
class OverrideDriverToRackTestTest < DrivenBySeleniumWithChrome |
eileencodes
Mar 28, 2017
Member
I was confused why this test was necessary when the test before works with rack_test
. Can you rename it to OverrideSeleniumSubclassToRackTestTest
so it's clearer?
I was confused why this test was necessary when the test before works with rack_test
. Can you rename it to OverrideSeleniumSubclassToRackTestTest
so it's clearer?
Sometimes we want to use rack_test partially instead of selenium for test speed: ```ruby class ApplicationSystemTestCase < ActionDispatch::SystemTestCase driven_by :selenium, using: :chrome, screen_size: [1400, 1400], options: {url: "http://chrome:4444/wd/hub"} end class WithJavaScriptTest < ApplicationSystemTestCase end class WithoutJavaScriptTest < ApplicationSystemTestCase driven_by :rack_test end ``` In the abobe case, `WithoutJavaScriptTest` uses selenium because `SystemTestCase` calls superclass' driver on `#initialize` (`self.class.superclass.driver.use`). Using `class_attribute` can handle inherited `driven_by`.
@eileencodes I renamed the test class! |
eileencodes
added a commit
that referenced
this pull request
Mar 29, 2017
Make `driven_by` overridable
Backported to 5-1-stable in 41412ef |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Sometimes we want to use rack_test partially instead of selenium for test speed:
In the abobe case,
WithoutJavascriptTest
uses selenium becauseSystemTestCase
calls superclass' driver on#initialize
(self.class.superclass.driver.use
).Using
class_attribute
can handle inheriteddriven_by
.