mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Fix system test by choosing Cancel on basic auth alert
This commit is contained in:
@@ -255,7 +255,8 @@ group :test do
|
||||
gem 'capybara', '~> 3.39.0'
|
||||
gem 'capybara-screenshot', '~> 1.0.17'
|
||||
gem 'cuprite', '~> 0.15.0'
|
||||
gem 'selenium-webdriver', '~> 4.15.0'
|
||||
gem 'selenium-devtools'
|
||||
gem 'selenium-webdriver', '~> 4.15'
|
||||
gem 'capybara_accessible_selectors', git: 'https://github.com/citizensadvice/capybara_accessible_selectors', branch: 'main'
|
||||
|
||||
gem 'fuubar', '~> 2.5.0'
|
||||
|
||||
+5
-2
@@ -938,7 +938,9 @@ GEM
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.12.0)
|
||||
secure_headers (6.5.0)
|
||||
selenium-webdriver (4.15.0)
|
||||
selenium-devtools (0.120.0)
|
||||
selenium-webdriver (~> 4.2)
|
||||
selenium-webdriver (4.16.0)
|
||||
rexml (~> 3.2, >= 3.2.5)
|
||||
rubyzip (>= 1.2.2, < 3.0)
|
||||
websocket (~> 1.0)
|
||||
@@ -1210,7 +1212,8 @@ DEPENDENCIES
|
||||
rubytree (~> 2.0.0)
|
||||
sanitize (~> 6.1.0)
|
||||
secure_headers (~> 6.5.0)
|
||||
selenium-webdriver (~> 4.15.0)
|
||||
selenium-devtools
|
||||
selenium-webdriver (~> 4.15)
|
||||
semantic (~> 1.6.1)
|
||||
shoulda-context (~> 2.0)
|
||||
shoulda-matchers (~> 5.0)
|
||||
|
||||
@@ -128,8 +128,13 @@ RSpec.describe 'authorization for BCF api', :js, with_config: { edition: 'bim' }
|
||||
|
||||
logout
|
||||
|
||||
# A basic auth alert is displayed asking to enter name and password
|
||||
# Register some basic auth credentials
|
||||
# A non-matching url is used so that capybara will issue a CancelAuth instead of trying to authenticate
|
||||
page.driver.browser.register(username: 'foo', password: 'bar', uri: /does_not_match/)
|
||||
# While not being logged in and without a token, the api cannot be accessed
|
||||
visit("/api/bcf/2.1/projects/#{project.id}")
|
||||
# Cancel button of basic auth should have been chosen now
|
||||
expect(page)
|
||||
.to have_content(JSON.dump({ message: "You need to be authenticated to access this resource." }))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user