aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/system_testing/server_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/dispatch/system_testing/server_test.rb')
-rw-r--r--actionpack/test/dispatch/system_testing/server_test.rb23
1 files changed, 19 insertions, 4 deletions
diff --git a/actionpack/test/dispatch/system_testing/server_test.rb b/actionpack/test/dispatch/system_testing/server_test.rb
index 10412d6367..95e411faf4 100644
--- a/actionpack/test/dispatch/system_testing/server_test.rb
+++ b/actionpack/test/dispatch/system_testing/server_test.rb
@@ -1,17 +1,32 @@
+# frozen_string_literal: true
+
require "abstract_unit"
require "capybara/dsl"
require "action_dispatch/system_testing/server"
class ServerTest < ActiveSupport::TestCase
setup do
+ @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 "initializing the server port" do
- assert_includes Capybara.servers, :rails_puma
+ 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 "port is always included" do
- assert Capybara.always_include_port, "expected Capybara.always_include_port to be true"
+ 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