test/helpers_test.rb in sinatra-assetpack-0.0.5 vs test/helpers_test.rb in sinatra-assetpack-0.0.6

- old
+ new

@@ -1,23 +1,30 @@ require File.expand_path('../test_helper', __FILE__) class HelpersTest < UnitTest - Main.get '/img/foo' do - img '/images/foo.jpg' - end + Main.get('/helper/foo') { img '/images/foo.jpg' } + Main.get('/helper/email') { img '/images/email.png' } + Main.get('/helper/css/all') { css :application, :sq } + Main.get('/helper/css/app') { css :application } + Main.get('/helper/css/sq') { css :sq } - Main.get '/img/email' do - img '/images/email.png' - end - test "img non-existing" do - get '/img/foo' + get '/helper/foo' assert body == "<img src='/images/foo.jpg' />" end test "img existing" do - get '/img/email' + get '/helper/email' assert body =~ %r{src='/images/email.[0-9]+.png'} assert body =~ %r{width='16'} assert body =~ %r{height='16'} + end + + test "css" do + re = Array.new + get '/helper/css/app'; re << body + get '/helper/css/sq'; re << body + + get '/helper/css/all' + assert body.gsub(/[\r\n]*/m, '') == re.join('') end end