Skip to content

Change the system tests to set Puma as default server only when the user haven't specified manually another server. #31384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2017

Conversation

guilleiguaran
Copy link
Member

In our app we are configuring a custom server for Capybara in this way:

Capybara.register_server(:unicorn) do |app, port, host|
  Unicorn::HttpServer.new(app, listeners: "#{host}:#{port}", logger: Logger.new(nil)).start.join
end

Capybara.server = :unicorn

But System Tests are overriding the Capybara.server to :puma so our configuration isn't taking effect.

With this change, the Capybara.server is set only if the user hasn't customized it manually (so it's other than :default).

…ser haven't specified manually another server.
@eileencodes
Copy link
Member

What do you think about adding Unicorn as a server option instead? I originally had support for that but since Puma was the default for rails we dropped support for setting drivers.

We can also consider doing that later. This PR works if you're in a bind. 😄

@guilleiguaran guilleiguaran merged commit 1b24fb2 into master Dec 9, 2017
@guilleiguaran
Copy link
Member Author

@eileencodes will do it!! but first I'll prepare a PR to add it as server option in Capybara side

@kamipo kamipo deleted the dont-override-server branch December 10, 2017 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants