aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_testing/server.rb
blob: 62ba07736bef546b3adbc7de7f79d8765474c748 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require "rack/handler/puma"

module ActionDispatch
  module SystemTesting
    class Server # :nodoc:
      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")
          end
        end

        def setup
          Capybara.server = :rails_puma
        end
    end
  end
end