Skip to content

Commit bc80fac

Browse files
committed
Make puma log silence completely
1 parent 46d10ea commit bc80fac

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace :generate do
6060

6161
# Rails 4 cannot use a `rails` binstub generated by Bundler
6262
sh "rm -f #{bindir}/rails"
63-
sh "bundle exec rails new ./tmp/example_app --no-rc --skip-javascript --skip-sprockets --skip-git --skip-test-unit --skip-listen --skip-bundle --template=example_app_generator/generate_app.rb"
63+
sh "bundle exec rails new ./tmp/example_app --no-rc --skip-javascript --skip-git --skip-test-unit --skip-listen --skip-bundle --template=example_app_generator/generate_app.rb"
6464

6565
in_example_app do
6666
sh "./travis_retry_bundle_install.sh 2>&1"

features/system_specs/system_specs.feature

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Feature: System spec
1010

1111

1212
@system_test
13-
Scenario: System specs
13+
Scenario: System specs driven by rack_test
1414
Given a file named "spec/system/widget_system_spec.rb" with:
1515
"""ruby
1616
require "rails_helper"
@@ -33,3 +33,29 @@ Feature: System spec
3333
When I run `rspec spec/system/widget_system_spec.rb`
3434
Then the exit status should be 0
3535
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"

lib/rspec/rails/example/system_example_group.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def app
4646
end
4747

4848
included do |other|
49+
ActiveSupport.on_load(:action_dispatch_system_test_case) do
50+
ActionDispatch::SystemTesting::Server.silence_puma = true
51+
end
52+
4953
begin
5054
require 'capybara'
5155
require 'action_dispatch/system_test_case'
@@ -71,7 +75,7 @@ def app
7175

7276
attr_reader :driver
7377

74-
if ActionDispatch::SystemTesting::Server.respond_to?(:silence_puma=)
78+
if ::Rails.version.to_f == 5.1
7579
ActionDispatch::SystemTesting::Server.silence_puma = true
7680
end
7781

0 commit comments

Comments
 (0)