diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2017-09-18 16:46:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-18 16:46:26 -0400 |
commit | 42d09f6b49da619952267b22bd8800d9b816886b (patch) | |
tree | 7d80fa1529ca0e7c11b31c642e9cf9a0ea55a533 | |
parent | e4017d0288fff13be9e97335c37ebbd30d1e94ea (diff) | |
parent | ba04b580c6e56e366b1b8e4ef003e9a0c1c419bb (diff) | |
download | rails-42d09f6b49da619952267b22bd8800d9b816886b.tar.gz rails-42d09f6b49da619952267b22bd8800d9b816886b.tar.bz2 rails-42d09f6b49da619952267b22bd8800d9b816886b.zip |
Merge pull request #30638 from twalpole/capybara_server
Use the default Capybara registered puma server configuration
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | Gemfile.lock | 2 | ||||
-rw-r--r-- | actionpack/CHANGELOG.md | 7 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/system_testing/server.rb | 14 | ||||
-rw-r--r-- | actionpack/test/dispatch/system_testing/server_test.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/Gemfile | 2 |
6 files changed, 11 insertions, 20 deletions
@@ -15,7 +15,7 @@ gem "rake", ">= 11.1" # be loaded after loading the test library. gem "mocha", "~> 0.14", require: false -gem "capybara", "~> 2.13" +gem "capybara", "~> 2.15" gem "rack-cache", "~> 1.2" gem "jquery-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 787631ada5..fb18fdc14e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -490,7 +490,7 @@ DEPENDENCIES blade-sauce_labs_plugin bootsnap (>= 1.1.0) byebug - capybara (~> 2.13) + capybara (~> 2.15) coffee-rails dalli (>= 2.2.1) delayed_job diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 932968fa35..a53d8efee1 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,10 @@ +* Use Capybara registered `:puma` server config. + + The Capybara registered `:puma` server ensures the puma server is run in process so + connection sharing and open request detection work correctly by default. + + *Thomas Walpole* + * Cookies `:expires` option supports `ActiveSupport::Duration` object. cookies[:user_name] = { value: "assain", expires: 1.hour } diff --git a/actionpack/lib/action_dispatch/system_testing/server.rb b/actionpack/lib/action_dispatch/system_testing/server.rb index 76bada8df1..32aa6a4dc4 100644 --- a/actionpack/lib/action_dispatch/system_testing/server.rb +++ b/actionpack/lib/action_dispatch/system_testing/server.rb @@ -12,29 +12,17 @@ module ActionDispatch self.silence_puma = false def run - register setup end private - def register - Capybara.register_server :rails_puma do |app, port, host| - Rack::Handler::Puma.run( - app, - Port: port, - Threads: "0:1", - Silent: self.class.silence_puma - ) - end - end - def setup set_server set_port end def set_server - Capybara.server = :rails_puma + Capybara.server = :puma, { Silent: self.class.silence_puma } end def set_port diff --git a/actionpack/test/dispatch/system_testing/server_test.rb b/actionpack/test/dispatch/system_testing/server_test.rb index ed65d93e49..1866225fc1 100644 --- a/actionpack/test/dispatch/system_testing/server_test.rb +++ b/actionpack/test/dispatch/system_testing/server_test.rb @@ -9,10 +9,6 @@ class ServerTest < ActiveSupport::TestCase ActionDispatch::SystemTesting::Server.new.run end - test "initializing the server port" do - assert_includes Capybara.servers, :rails_puma - end - test "port is always included" do assert Capybara.always_include_port, "expected Capybara.always_include_port to be true" end diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 770247d8ca..bfbba789b0 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -41,7 +41,7 @@ group :development, :test do gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] <%- if depends_on_system_test? -%> # Adds support for Capybara system testing and selenium driver - gem 'capybara', '~> 2.13' + gem 'capybara', '~> 2.15' gem 'selenium-webdriver' <%- end -%> end |