aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-09-04 11:32:57 +0100
committerLouise Crow <louise.crow@gmail.com>2014-09-04 11:32:57 +0100
commit43edd82fb495e1dda39bdfa0c76de29f6bbbc57a (patch)
tree4065de56b6def0b03a0d0c2bfdd121d8cb4ed9d2 /spec/models
parent6d215fba5cc709c43f12f86da39a643e4be5922b (diff)
Fix for purging of cached attachments for non-default locales.0.17.0.4hotfix/0.17.0.4
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/info_request_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb
index 9766f928f..1dda253a8 100644
--- a/spec/models/info_request_spec.rb
+++ b/spec/models/info_request_spec.rb
@@ -146,6 +146,23 @@ describe InfoRequest do
end
+ describe 'when managing the cache directories' do
+ before do
+ @info_request = info_requests(:fancy_dog_request)
+ end
+
+ it 'should return the default locale cache path without locale parts' do
+ default_locale_path = File.join(Rails.root, 'cache', 'views', 'request', '101', '101')
+ @info_request.foi_fragment_cache_directories.include?(default_locale_path).should == true
+ end
+
+ it 'should return the cache path for any other locales' do
+ other_locale_path = File.join(Rails.root, 'cache', 'views', 'es', 'request', '101', '101')
+ @info_request.foi_fragment_cache_directories.include?(other_locale_path).should == true
+ end
+
+ end
+
describe " when emailing" do
before do