projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '12690-12748-crunchstat-summary'
[arvados.git]
/
apps
/
workbench
/
test
/
controllers
/
application_controller_test.rb
diff --git
a/apps/workbench/test/controllers/application_controller_test.rb
b/apps/workbench/test/controllers/application_controller_test.rb
index d38e88f2a60047545d2828664a45428ca4385e21..45952ceba3ef46fa14378c8e3351fc79d7031df0 100644
(file)
--- a/
apps/workbench/test/controllers/application_controller_test.rb
+++ b/
apps/workbench/test/controllers/application_controller_test.rb
@@
-338,11
+338,11
@@
class ApplicationControllerTest < ActionController::TestCase
assert_response 404
end
assert_response 404
end
- test "requesting to the API server includes
client_session_id param
" do
- got_
query
= nil
+ test "requesting to the API server includes
X-Request-Id header
" do
+ got_
header
= nil
stub_api_calls
stub_api_calls
- stub_api_client.stubs(:post).with do |url, query,
opts
={}|
- got_
query = query
+ stub_api_client.stubs(:post).with do |url, query,
header
={}|
+ got_
header = header
true
end.returns fake_api_response('{}', 200, {})
true
end.returns fake_api_response('{}', 200, {})
@@
-352,14
+352,21
@@
class ApplicationControllerTest < ActionController::TestCase
test_uuid = "zzzzz-j7d0g-zzzzzzzzzzzzzzz"
get(:show, {id: test_uuid})
test_uuid = "zzzzz-j7d0g-zzzzzzzzzzzzzzz"
get(:show, {id: test_uuid})
- assert_includes got_query, 'current_request_id'
- assert_match /\d{10}-\d{9}/, got_query['current_request_id']
+ assert_not_nil got_header
+ assert_includes got_header, 'X-Request-Id'
+ assert_match /^req-[0-9a-zA-Z]{20}$/, got_header["X-Request-Id"]
end
end
- test "current
_
request_id is nil after a request" do
+ test "current
request_id is nil after a request" do
@controller = NodesController.new
get(:index, {}, session_for(:active))
@controller = NodesController.new
get(:index, {}, session_for(:active))
- assert_nil Thread.current[:current_request_id]
+ assert_nil Thread.current[:request_id]
+ end
+
+ test "X-Request-Id header" do
+ @controller = NodesController.new
+ get(:index, {}, session_for(:active))
+ assert_match /^req-[0-9a-zA-Z]{20}$/, response.headers['X-Request-Id']
end
[".navbar .login-menu a",
end
[".navbar .login-menu a",
@@
-374,7
+381,7
@@
class ApplicationControllerTest < ActionController::TestCase
get(:show, {id: test_uuid})
login_link = css_select(css_selector).first
assert_not_nil(login_link, "failed to select login link")
get(:show, {id: test_uuid})
login_link = css_select(css_selector).first
assert_not_nil(login_link, "failed to select login link")
- login_href = URI.unescape(login_link.attributes["href"])
+ login_href = URI.unescape(login_link.attributes["href"]
.value
)
# The parameter needs to include the full URL to work.
assert_includes(login_href, "://")
assert_match(/[\?&]return_to=[^&]*\/projects\/#{test_uuid}(&|$)/,
# The parameter needs to include the full URL to work.
assert_includes(login_href, "://")
assert_match(/[\?&]return_to=[^&]*\/projects\/#{test_uuid}(&|$)/,