Skip to content
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

fix(appengine): address testing errors on helloworld, websockets, rails-cloudsql-mysql #1539

Merged
merged 8 commits into from
Feb 14, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
scenario "should display a list of cats" do
visit root_path

expect(page).to have_content "Ms. Paws\t2"
expect(page).to have_content "Mr. Whiskers\t4"
expect(page).to have_content "Ms. Paws 2"
expect(page).to have_content "Mr. Whiskers 4"
end
end
4 changes: 2 additions & 2 deletions appengine/rails-cloudsql-mysql/spec/features/cats_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
scenario "should display a list of cats" do
visit root_path

expect(page).to have_content "Ms. Paws\t2"
expect(page).to have_content "Mr. Whiskers\t4"
expect(page).to have_content "Ms. Paws 2"
expect(page).to have_content "Mr. Whiskers 4"
end
end
4 changes: 3 additions & 1 deletion appengine/rails-cloudsql-mysql/spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
# Checks for pending migration and applies them before tests are run.
ActiveRecord::Migration.maintain_test_schema!

Capybara.current_driver = :cuprite
Capybara.register_driver :cuprite do |app|
Capybara::Cuprite::Driver.new(app, browser_options: {'no-sandbox': nil})
end

RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
Expand Down
6 changes: 6 additions & 0 deletions appengine/standard-hello_world/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

# [START gae_standard_quickstart]
require "sinatra"
# [END gae_standard_quickstart]
configure :development do
set :host_authorization, { permitted_hosts: [] }
end

# [START gae_standard_quickstart]

get "/" do
"Hello world!"
Expand Down
6 changes: 6 additions & 0 deletions appengine/websockets/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
require "sinatra"
require "faye/websocket"
require "thin"
# [END gae_flex_websockets]

configure :development do
set :host_authorization, { permitted_hosts: [] }
end
# [START gae_flex_websockets]

Faye::WebSocket.load_adapter "thin"

Expand Down
4 changes: 4 additions & 0 deletions appengine/websockets/spec/websockets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

Capybara.app = Sinatra::Application

Capybara.register_driver :cuprite do |app|
Capybara::Cuprite::Driver.new(app, browser_options: {'no-sandbox': nil})
end

Capybara.register_server :thin do |app, port, host|
require "rack/handler/thin"
Rack::Handler::Thin.run(app, :Port => port, :Host => host)
Expand Down
Loading