FIX: Clean up specs.
This commit is contained in:
parent
0fbb3fb02b
commit
b45fd21ed9
|
@ -4,13 +4,21 @@ describe StaticController do
|
||||||
|
|
||||||
context 'brotli_asset' do
|
context 'brotli_asset' do
|
||||||
it 'has correct headers for brotli assets' do
|
it 'has correct headers for brotli assets' do
|
||||||
FileUtils.mkdir_p(Rails.root + "public/assets/")
|
begin
|
||||||
File.write(Rails.root + "public/assets/test.js.br", 'fake brotli file')
|
assets_path = Rails.root.join("public/assets")
|
||||||
|
|
||||||
|
FileUtils.mkdir_p(assets_path)
|
||||||
|
|
||||||
|
file_path = assets_path.join("test.js.br")
|
||||||
|
File.write(file_path, 'fake brotli file')
|
||||||
|
|
||||||
get :brotli_asset, path: 'test.js'
|
get :brotli_asset, path: 'test.js'
|
||||||
|
|
||||||
expect(response.status).to eq(200)
|
expect(response.status).to eq(200)
|
||||||
expect(response.headers["Cache-Control"]).to match(/public/)
|
expect(response.headers["Cache-Control"]).to match(/public/)
|
||||||
|
ensure
|
||||||
|
File.delete(file_path)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue