diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-04 20:05:35 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-04 20:05:35 +0200 |
commit | 6b79463ed8d04c7807c0695fcb3d4c11e4be9fa2 (patch) | |
tree | f2fdbdf2abedea3cd619ece126918910c8bdd86a /actionpack/test/dispatch | |
parent | a93bd11b1d90da5abdef11c2774bb9bafe27bfb1 (diff) | |
download | rails-6b79463ed8d04c7807c0695fcb3d4c11e4be9fa2.tar.gz rails-6b79463ed8d04c7807c0695fcb3d4c11e4be9fa2.tar.bz2 rails-6b79463ed8d04c7807c0695fcb3d4c11e4be9fa2.zip |
Fix .subdomain regression.
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/request_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb index fb2faf7a4e..d128006404 100644 --- a/actionpack/test/dispatch/request_test.rb +++ b/actionpack/test/dispatch/request_test.rb @@ -137,30 +137,39 @@ class RequestTest < ActiveSupport::TestCase test "subdomains" do request = stub_request 'HTTP_HOST' => "www.rubyonrails.org" assert_equal %w( www ), request.subdomains + assert_equal "www", request.subdomain request = stub_request 'HTTP_HOST' => "www.rubyonrails.co.uk" assert_equal %w( www ), request.subdomains(2) + assert_equal "www", request.subdomain(2) request = stub_request 'HTTP_HOST' => "dev.www.rubyonrails.co.uk" assert_equal %w( dev www ), request.subdomains(2) + assert_equal "dev.www", request.subdomain(2) request = stub_request 'HTTP_HOST' => "dev.www.rubyonrails.co.uk", :tld_length => 2 assert_equal %w( dev www ), request.subdomains + assert_equal "dev.www", request.subdomain request = stub_request 'HTTP_HOST' => "foobar.foobar.com" assert_equal %w( foobar ), request.subdomains + assert_equal "foobar", request.subdomain request = stub_request 'HTTP_HOST' => "192.168.1.200" assert_equal [], request.subdomains + assert_equal "", request.subdomain request = stub_request 'HTTP_HOST' => "foo.192.168.1.200" assert_equal [], request.subdomains + assert_equal "", request.subdomain request = stub_request 'HTTP_HOST' => "192.168.1.200.com" assert_equal %w( 192 168 1 ), request.subdomains + assert_equal "192.168.1", request.subdomain request = stub_request 'HTTP_HOST' => nil assert_equal [], request.subdomains + assert_equal "", request.subdomain end test "standard_port" do |