spec/integration/assets/spike_spec.rb in mbj-assets-0.0.4 vs spec/integration/assets/spike_spec.rb in mbj-assets-0.0.5
- old
+ new
@@ -26,13 +26,20 @@
repository.glob('*.jpg').map do |name|
repository.file(name)
end
end
+ let(:web_fonts) do
+ repository.glob('*.woff').map do |name|
+ repository.file(name)
+ end
+ end
+
let(:rules) do
rules = []
rules.concat(images)
+ rules.concat(web_fonts)
rules << repository.compile('application.coffee')
rules << stylesheet
end
let(:environment) do
@@ -79,9 +86,18 @@
its(:content_type) { should eql('image/jpg') }
its(:last_modified) { should eql(Time.httpdate(asset.created_at.httpdate)) }
its(:cache_control) { should eql('max-age=120, must-revalidate') }
its(:status) { should be(Response::Status::OK) }
its(:body) { should eql(expected_body) }
+ end
+
+ context 'accessing woff web font' do
+ let(:name) { 'droid-sans.woff' }
+ let(:extra_hash) { {} }
+ let(:expected_body) { File.read('spec/assets/droid-sans.woff') }
+
+ its(:content_type) { should eql('application/font-woff') }
+ its(:body) { should eql(expected_body) }
end
context 'compiling coffescript' do
let(:name) { 'application.js' }
let(:extra_hash) { {} }