aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-02-20 20:45:01 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-02-20 20:47:59 -0200
commit027d484f1d0c77855c09099091f7c3b5c976a7c0 (patch)
treeb21ca15b134ebacf5d5b64b44197bb630435c605 /actionpack/test/dispatch
parent7f5cf3a3daececa062299a2b9c86631aa0c3a0cb (diff)
downloadrails-027d484f1d0c77855c09099091f7c3b5c976a7c0.tar.gz
rails-027d484f1d0c77855c09099091f7c3b5c976a7c0.tar.bz2
rails-027d484f1d0c77855c09099091f7c3b5c976a7c0.zip
Prefer request_id over uuid and test the alias
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/request_id_test.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/actionpack/test/dispatch/request_id_test.rb b/actionpack/test/dispatch/request_id_test.rb
index a307483509..00d8caf8f4 100644
--- a/actionpack/test/dispatch/request_id_test.rb
+++ b/actionpack/test/dispatch/request_id_test.rb
@@ -2,19 +2,23 @@ require 'abstract_unit'
class RequestIdTest < ActiveSupport::TestCase
test "passing on the request id from the outside" do
- assert_equal "external-uu-rid", stub_request('HTTP_X_REQUEST_ID' => 'external-uu-rid').uuid
+ assert_equal "external-uu-rid", stub_request('HTTP_X_REQUEST_ID' => 'external-uu-rid').request_id
end
test "ensure that only alphanumeric uurids are accepted" do
- assert_equal "X-Hacked-HeaderStuff", stub_request('HTTP_X_REQUEST_ID' => '; X-Hacked-Header: Stuff').uuid
+ assert_equal "X-Hacked-HeaderStuff", stub_request('HTTP_X_REQUEST_ID' => '; X-Hacked-Header: Stuff').request_id
end
test "ensure that 255 char limit on the request id is being enforced" do
- assert_equal "X" * 255, stub_request('HTTP_X_REQUEST_ID' => 'X' * 500).uuid
+ assert_equal "X" * 255, stub_request('HTTP_X_REQUEST_ID' => 'X' * 500).request_id
end
test "generating a request id when none is supplied" do
- assert_match(/\w+-\w+-\w+-\w+-\w+/, stub_request.uuid)
+ assert_match(/\w+-\w+-\w+-\w+-\w+/, stub_request.request_id)
+ end
+
+ test "uuid alias" do
+ assert_equal "external-uu-rid", stub_request('HTTP_X_REQUEST_ID' => 'external-uu-rid').uuid
end
private