Skip to content

Commit 459ef7a

Browse files
authored
fix(appengine): address testing errors on helloworld, websockets, rails-cloudsql-mysql (#1539)
1 parent 773f23c commit 459ef7a

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

appengine/flexible/ruby31-and-earlier/rails-cloudsql-mysql/spec/features/cats_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
scenario "should display a list of cats" do
2020
visit root_path
2121

22-
expect(page).to have_content "Ms. Paws\t2"
23-
expect(page).to have_content "Mr. Whiskers\t4"
22+
expect(page).to have_content "Ms. Paws 2"
23+
expect(page).to have_content "Mr. Whiskers 4"
2424
end
2525
end

appengine/rails-cloudsql-mysql/spec/features/cats_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
scenario "should display a list of cats" do
2020
visit root_path
2121

22-
expect(page).to have_content "Ms. Paws\t2"
23-
expect(page).to have_content "Mr. Whiskers\t4"
22+
expect(page).to have_content "Ms. Paws 2"
23+
expect(page).to have_content "Mr. Whiskers 4"
2424
end
2525
end

appengine/rails-cloudsql-mysql/spec/rails_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
# Checks for pending migration and applies them before tests are run.
1414
ActiveRecord::Migration.maintain_test_schema!
1515

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

1820
RSpec.configure do |config|
1921
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures

appengine/standard-hello_world/app.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414

1515
# [START gae_standard_quickstart]
1616
require "sinatra"
17+
# [END gae_standard_quickstart]
18+
configure :development do
19+
set :host_authorization, { permitted_hosts: [] }
20+
end
21+
22+
# [START gae_standard_quickstart]
1723

1824
get "/" do
1925
"Hello world!"

appengine/websockets/app.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
require "sinatra"
1919
require "faye/websocket"
2020
require "thin"
21+
# [END gae_flex_websockets]
22+
23+
configure :development do
24+
set :host_authorization, { permitted_hosts: [] }
25+
end
26+
# [START gae_flex_websockets]
2127

2228
Faye::WebSocket.load_adapter "thin"
2329

appengine/websockets/spec/websockets_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
Capybara.app = Sinatra::Application
2323

24+
Capybara.register_driver :cuprite do |app|
25+
Capybara::Cuprite::Driver.new(app, browser_options: {'no-sandbox': nil})
26+
end
27+
2428
Capybara.register_server :thin do |app, port, host|
2529
require "rack/handler/thin"
2630
Rack::Handler::Thin.run(app, :Port => port, :Host => host)

0 commit comments

Comments
 (0)