aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-07-27 21:47:59 +0800
committerJosé Valim <jose.valim@gmail.com>2010-07-28 21:02:45 +0800
commit7d29627be91027cb6b616d21bc97e5066901d907 (patch)
tree27a856fd4d3f3a4c1ee90f35722da7d9a16a929c /activesupport
parent3265af5c8b98da0d9f292fcc2feddc2da02e652d (diff)
downloadrails-7d29627be91027cb6b616d21bc97e5066901d907.tar.gz
rails-7d29627be91027cb6b616d21bc97e5066901d907.tar.bz2
rails-7d29627be91027cb6b616d21bc97e5066901d907.zip
test cases for rails_app_version in AS cache.rb
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/test/caching_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index ed9b53f593..8497e44554 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -9,6 +9,7 @@ class CacheKeyTest < ActiveSupport::TestCase
end
def test_expand_cache_key_with_rails_cache_id
+ ENV['RAILS_APP_VERSION'] = nil
ENV['RAILS_CACHE_ID'] = 'c99'
assert_equal 'c99/foo', ActiveSupport::Cache.expand_cache_key(:foo)
assert_equal 'c99/foo', ActiveSupport::Cache.expand_cache_key([:foo])
@@ -17,6 +18,19 @@ class CacheKeyTest < ActiveSupport::TestCase
assert_equal 'nm/c99/foo', ActiveSupport::Cache.expand_cache_key([:foo], :nm)
assert_equal 'nm/c99/c99/foo/c99/bar', ActiveSupport::Cache.expand_cache_key([:foo, :bar], :nm)
end
+
+ def test_expand_cache_key_with_rails_app_version
+ ENV['RAILS_CACHE_ID'] = nil
+ ENV['RAILS_APP_VERSION'] = 'rails3'
+ assert_equal 'rails3/foo', ActiveSupport::Cache.expand_cache_key(:foo)
+ end
+
+ def test_expand_cache_key_rails_cache_id_should_win_over_rails_app_version
+ ENV['RAILS_CACHE_ID'] = 'c99'
+ ENV['RAILS_APP_VERSION'] = 'rails3'
+ assert_equal 'c99/foo', ActiveSupport::Cache.expand_cache_key(:foo)
+ end
+
end
class CacheStoreSettingTest < ActiveSupport::TestCase