projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '19954-permission-dedup-doc'
[arvados.git]
/
apps
/
workbench
/
test
/
integration
/
logins_test.rb
diff --git
a/apps/workbench/test/integration/logins_test.rb
b/apps/workbench/test/integration/logins_test.rb
index be7e4e15a5692d5b47ce433fb5647cbb7159bd29..3c6ab7c7436e1ddb06621a01136ba85673ec78f2 100644
(file)
--- a/
apps/workbench/test/integration/logins_test.rb
+++ b/
apps/workbench/test/integration/logins_test.rb
@@
-1,21
+1,23
@@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
require 'integration_helper'
class LoginsTest < ActionDispatch::IntegrationTest
require 'integration_helper'
class LoginsTest < ActionDispatch::IntegrationTest
+ setup do
+ need_javascript
+ end
+
test "login with api_token works after redirect" do
visit page_with_token('active_trustedclient')
test "login with api_token works after redirect" do
visit page_with_token('active_trustedclient')
- assert page.has_text?('Recent
jobs'), "Missing 'Recent job
s' from page"
+ assert page.has_text?('Recent
processes'), "Missing 'Recent processe
s' from page"
assert_no_match(/\bapi_token=/, current_path)
end
assert_no_match(/\bapi_token=/, current_path)
end
- test "can't use expired token" do
- visit page_with_token('expired_trustedclient')
- assert page.has_text? 'Log in'
- end
-
- test "expired token yields login page, not error page" do
+ test "trying to use expired token redirects to login page" do
visit page_with_token('expired_trustedclient')
visit page_with_token('expired_trustedclient')
- # Even the error page has a "Log in" link. We should look for
- # something that only appears the real login page.
- assert page.has_text? ' Log in Oh... fiddlesticks. Sorry, I had some trouble handling your request'
+ buttons = all("button.btn", text: /Log in/)
+ assert_equal(1, buttons.size, "Failed to find one login button")
end
end
end
end