fix stylesheet cache to recover if file is on disk

This commit is contained in:
Sam
2015-05-22 11:22:12 +10:00
parent 17d843a0ad
commit 96dbeb8608
4 changed files with 50 additions and 11 deletions
@@ -0,0 +1,25 @@
require 'spec_helper'
describe StylesheetsController do
it 'can survive cache miss' do
DiscourseStylesheets.cache.clear
DiscourseStylesheets.stylesheet_link_tag('desktop_rtl')
StylesheetCache.destroy_all
# digestless
get :show, name: 'desktop_rtl'
expect(response).to be_success
# tmp folder destruction and cached
`rm #{DiscourseStylesheets.cache_fullpath}/*`
get :show, name: 'desktop_rtl'
expect(response).to be_success
# there is an edge case which is ... disk and db cache is nuked, very unlikely to happen
end
end