aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/cookies_test.rb
diff options
context:
space:
mode:
authorBryce Thornton <brycethornton@gmail.com>2010-08-14 15:35:01 -0400
committerJosé Valim <jose.valim@gmail.com>2010-08-15 16:42:02 -0300
commitfd78bb727045547371179428886c9b262d66091d (patch)
treecf7e194c3d12397429f74e67a2b3154b5d1563dc /actionpack/test/dispatch/cookies_test.rb
parentada8c66ba06777177f9313198f404fdd1458d24d (diff)
downloadrails-fd78bb727045547371179428886c9b262d66091d.tar.gz
rails-fd78bb727045547371179428886c9b262d66091d.tar.bz2
rails-fd78bb727045547371179428886c9b262d66091d.zip
Allow for any possible TLD when using the :all option with the cookie session store. This works for subdomain.mysite.local, google.co.uk, google.com.au, etc. [#5147 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/dispatch/cookies_test.rb')
-rw-r--r--actionpack/test/dispatch/cookies_test.rb30
1 files changed, 29 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb
index b04c1a42c0..cadae5d97f 100644
--- a/actionpack/test/dispatch/cookies_test.rb
+++ b/actionpack/test/dispatch/cookies_test.rb
@@ -232,6 +232,34 @@ class CookiesTest < ActionController::TestCase
assert_cookie_header "user_name=rizwanreza; domain=.nextangle.com; path=/"
end
+ def test_cookie_with_all_domain_option_using_a_non_standard_tld
+ @request.host = "two.subdomains.nextangle.local"
+ get :set_cookie_with_domain
+ assert_response :success
+ assert_cookie_header "user_name=rizwanreza; domain=.nextangle.local; path=/"
+ end
+
+ def test_cookie_with_all_domain_option_using_australian_style_tld
+ @request.host = "nextangle.com.au"
+ get :set_cookie_with_domain
+ assert_response :success
+ assert_cookie_header "user_name=rizwanreza; domain=.nextangle.com.au; path=/"
+ end
+
+ def test_cookie_with_all_domain_option_using_uk_style_tld
+ @request.host = "nextangle.co.uk"
+ get :set_cookie_with_domain
+ assert_response :success
+ assert_cookie_header "user_name=rizwanreza; domain=.nextangle.co.uk; path=/"
+ end
+
+ def test_cookie_with_all_domain_option_using_host_with_port
+ @request.host = "nextangle.local:3000"
+ get :set_cookie_with_domain
+ assert_response :success
+ assert_cookie_header "user_name=rizwanreza; domain=.nextangle.local; path=/"
+ end
+
def test_deleting_cookie_with_all_domain_option
get :delete_cookie_with_domain
assert_response :success
@@ -247,4 +275,4 @@ class CookiesTest < ActionController::TestCase
assert_equal expected.split("\n"), header
end
end
-end \ No newline at end of file
+end