forked from rstacruz/sinatra-assetpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmime_type_test.rb
53 lines (43 loc) · 1.29 KB
/
mime_type_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require File.expand_path('../test_helper', __FILE__)
class AppTest < UnitTest
test 'htc' do
get '/css/behavior.htc'
assert last_response.content_type =~ %r[^text/x-component]
end
test 'css - sass' do
get '/css/screen.css'
assert last_response.content_type =~ %r[^text/css]
end
test 'js' do
get '/js/hello.js'
assert last_response.content_type =~ %r[^.*?/javascript]
end
test 'js - coffee' do
get '/js/hi.js'
assert last_response.content_type =~ %r[^.*?/javascript]
end
test 'css - compressed' do
get '/css/application.css'
assert last_response.content_type =~ %r[^text/css]
end
test 'js - compressed' do
get '/skitch.js'
assert last_response.content_type =~ %r[^.*?/javascript]
end
test 'eot' do
get '/fonts/cantarell-regular-webfont.eot'
assert last_response.content_type =~ %r[^application/vnd.ms-fontobject]
end
test 'svg' do
get '/fonts/cantarell-regular-webfont.svg'
assert last_response.content_type =~ %r[^image/svg\+xml]
end
test 'ttf' do
get '/fonts/cantarell-regular-webfont.ttf'
assert last_response.content_type =~ %r[^application/octet-stream]
end
test 'woff' do
get '/fonts/cantarell-regular-webfont.woff'
assert last_response.content_type =~ %r[^application/font-woff]
end
end