diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2017-12-09 18:34:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-09 18:34:34 -0500 |
commit | 1b24fb213b820ebca29eb1d38efb07a410c7afaa (patch) | |
tree | 1a5318f23c7342d2980917a985277c61cf7204b6 /actionpack/test/dispatch | |
parent | 5d7b70f4336d42eabfc403e9f6efceb88b3eff44 (diff) | |
parent | f1b4cd1ad47eab55ab7b18ae0cc167fabf72f38b (diff) | |
download | rails-1b24fb213b820ebca29eb1d38efb07a410c7afaa.tar.gz rails-1b24fb213b820ebca29eb1d38efb07a410c7afaa.tar.bz2 rails-1b24fb213b820ebca29eb1d38efb07a410c7afaa.zip |
Merge pull request #31384 from rails/dont-override-server
Change the system tests to set Puma as default server only when the user haven't specified manually another server.
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/system_testing/server_test.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/system_testing/server_test.rb b/actionpack/test/dispatch/system_testing/server_test.rb index 1866225fc1..95e411faf4 100644 --- a/actionpack/test/dispatch/system_testing/server_test.rb +++ b/actionpack/test/dispatch/system_testing/server_test.rb @@ -6,10 +6,27 @@ require "action_dispatch/system_testing/server" class ServerTest < ActiveSupport::TestCase setup do - ActionDispatch::SystemTesting::Server.new.run + @old_capybara_server = Capybara.server end test "port is always included" do + ActionDispatch::SystemTesting::Server.new.run assert Capybara.always_include_port, "expected Capybara.always_include_port to be true" end + + test "server is changed from `default` to `puma`" do + Capybara.server = :default + ActionDispatch::SystemTesting::Server.new.run + refute_equal Capybara.server, Capybara.servers[:default] + end + + test "server is not changed to `puma` when is different than default" do + Capybara.server = :webrick + ActionDispatch::SystemTesting::Server.new.run + assert_equal Capybara.server, Capybara.servers[:webrick] + end + + teardown do + Capybara.server = @old_capybara_server + end end |