File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Feature: System spec
10
10
11
11
12
12
@system_test
13
- Scenario : System specs
13
+ Scenario : System specs driven by rack_test
14
14
Given a file named "spec/system/widget_system_spec.rb" with:
15
15
"""ruby
16
16
require "rails_helper"
@@ -33,3 +33,29 @@ Feature: System spec
33
33
When I run `rspec spec/system/widget_system_spec.rb`
34
34
Then the exit status should be 0
35
35
And the output should contain "1 example, 0 failures"
36
+
37
+ @system_test
38
+ Scenario : System specs driven by selenium_chrome_headless
39
+ Given a file named "spec/system/widget_system_spec.rb" with:
40
+ """ruby
41
+ require "rails_helper"
42
+
43
+ RSpec.describe "Widget management", :type => :system do
44
+ before do
45
+ driven_by(:selenium_chrome_headless)
46
+ end
47
+
48
+ it "enables me to create widgets" do
49
+ visit "/widgets/new"
50
+
51
+ fill_in "Name", :with => "My Widget"
52
+ click_button "Create Widget"
53
+
54
+ expect(page).to have_text("Widget was successfully created.")
55
+ end
56
+ end
57
+ """
58
+ When I run `rspec spec/system/widget_system_spec.rb`
59
+ Then the exit status should be 0
60
+ And the output should contain "1 example, 0 failures"
61
+ And the output should not contain "Puma starting"
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ def app
46
46
end
47
47
48
48
included do |other |
49
+ ActiveSupport . on_load ( :action_dispatch_system_test_case ) do
50
+ ActionDispatch ::SystemTesting ::Server . silence_puma = true
51
+ end
52
+
49
53
begin
50
54
require 'capybara'
51
55
require 'action_dispatch/system_test_case'
@@ -71,10 +75,6 @@ def app
71
75
72
76
attr_reader :driver
73
77
74
- if ActionDispatch ::SystemTesting ::Server . respond_to? ( :silence_puma= )
75
- ActionDispatch ::SystemTesting ::Server . silence_puma = true
76
- end
77
-
78
78
def initialize ( *args , &blk )
79
79
super ( *args , &blk )
80
80
@driver = nil
You can’t perform that action at this time.
0 commit comments