File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
appengine/standard-storage Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1616require "sinatra"
1717require "google/cloud/storage"
1818
19+ # [END gae_standard_storage_app]
20+ configure :development do
21+ set :host_authorization , { permitted_hosts : [ ] }
22+ end
23+
24+ # [START gae_standard_storage_app]
1925storage = Google ::Cloud ::Storage . new
2026bucket = storage . bucket ENV [ "GOOGLE_CLOUD_STORAGE_BUCKET" ]
2127
Original file line number Diff line number Diff line change 1919
2020describe "Cloud Storage" , type : :feature do
2121 before do
22- Capybara . current_driver = :cuprite
22+ Capybara . register_driver :cuprite do |app |
23+ Capybara ::Cuprite ::Driver . new ( app , browser_options : { 'no-sandbox' : nil } )
24+ end
2325 end
2426 it "can upload and get public URL of uploaded file" do
2527 Capybara . app = Sinatra ::Application
3133
3234 uploaded_file_public_url = page . find ( "body" ) . text
3335
34- visit uploaded_file_public_url
35- expect ( page ) . to have_content "This is the content of the test-upload.txt file"
36+ page = Net :: HTTP . get_response ( URI ( uploaded_file_public_url ) )
37+ expect ( page . body ) . to include "This is the content of the test-upload.txt file"
3638 end
3739end
You can’t perform that action at this time.
0 commit comments