File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ Feature: System spec
25
25
javascript, you do not need [DatabaseCleaner](https://github.com/DatabaseCleaner/database_cleaner).
26
26
27
27
@system_test
28
- Scenario : System specs
28
+ Scenario : System specs driven by rack_test
29
29
Given a file named "spec/system/widget_system_spec.rb" with:
30
30
"""ruby
31
31
require "rails_helper"
@@ -81,3 +81,29 @@ Feature: System spec
81
81
"""
82
82
When I run `rspec spec/system/some_job_system_spec.rb`
83
83
Then the example should pass
84
+
85
+ @system_test
86
+ Scenario : System specs driven by selenium_chrome_headless
87
+ Given a file named "spec/system/widget_system_spec.rb" with:
88
+ """ruby
89
+ require "rails_helper"
90
+
91
+ RSpec.describe "Widget management", :type => :system do
92
+ before do
93
+ driven_by(:selenium_chrome_headless)
94
+ end
95
+
96
+ it "enables me to create widgets" do
97
+ visit "/widgets/new"
98
+
99
+ fill_in "Name", :with => "My Widget"
100
+ click_button "Create Widget"
101
+
102
+ expect(page).to have_text("Widget was successfully created.")
103
+ end
104
+ end
105
+ """
106
+ When I run `rspec spec/system/widget_system_spec.rb`
107
+ Then the exit status should be 0
108
+ And the output should contain "1 example, 0 failures"
109
+ And the output should not contain "Puma starting"
Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ def app
50
50
end
51
51
52
52
included do |other |
53
+ ActiveSupport . on_load ( :action_dispatch_system_test_case ) do
54
+ ActionDispatch ::SystemTesting ::Server . silence_puma = true
55
+ end
56
+
53
57
begin
54
58
require 'capybara'
55
59
require 'action_dispatch/system_test_case'
@@ -77,7 +81,7 @@ def app
77
81
78
82
attr_reader :driver
79
83
80
- if ActionDispatch :: SystemTesting :: Server . respond_to? ( :silence_puma= )
84
+ if :: Rails . version . to_f == 5.1
81
85
ActionDispatch ::SystemTesting ::Server . silence_puma = true
82
86
end
83
87
You can’t perform that action at this time.
0 commit comments