diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-11-17 05:41:47 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-11-17 05:41:47 +0000 |
commit | 6d0e5eaf06c6f285201bdbb7948c31281f15f8c5 (patch) | |
tree | d30dcbd470f4a87cfc32e6d70cf357571a25e006 /actionpack/test/controller | |
parent | c07eae4d40b3450215e3aefb876dd5d983fc24bf (diff) | |
download | rails-6d0e5eaf06c6f285201bdbb7948c31281f15f8c5.tar.gz rails-6d0e5eaf06c6f285201bdbb7948c31281f15f8c5.tar.bz2 rails-6d0e5eaf06c6f285201bdbb7948c31281f15f8c5.zip |
memoize host with port and refactor the tests which depend on it changing
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 8 | ||||
-rw-r--r-- | actionpack/test/controller/request_test.rb | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index f3cf66232f..828b2fbf26 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -248,16 +248,22 @@ class ActionCacheTest < Test::Unit::TestCase @request.host = 'jamis.hostname.com' get :index jamis_cache = content_to_cache - + + reset! + @request.host = 'david.hostname.com' get :index david_cache = content_to_cache assert_not_equal jamis_cache, @response.body + reset! + @request.host = 'jamis.hostname.com' get :index assert_equal jamis_cache, @response.body + reset! + @request.host = 'david.hostname.com' get :index assert_equal david_cache, @response.body diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb index 0fc8889db9..1ade378739 100644 --- a/actionpack/test/controller/request_test.rb +++ b/actionpack/test/controller/request_test.rb @@ -252,11 +252,13 @@ class RequestTest < Test::Unit::TestCase end - def test_host_with_port + def test_host_with_default_port @request.host = "rubyonrails.org" @request.port = 80 assert_equal "rubyonrails.org", @request.host_with_port - + end + + def test_host_with_non_default_port @request.host = "rubyonrails.org" @request.port = 81 assert_equal "rubyonrails.org:81", @request.host_with_port |