test/helpers_test.rb in sinatra-assetpack-0.1.7 vs test/helpers_test.rb in sinatra-assetpack-0.2.0
- old
+ new
@@ -10,12 +10,23 @@
test "img non-existing" do
get '/helper/foo'
assert body == "<img src='/images/foo.jpg' />"
end
- test "img existing" do
+ test "img existing (development)" do
+ app.stubs(:development?).returns(true)
get '/helper/email'
- assert body =~ %r{src='/images/email.[0-9]+.png'}
+
+ assert body =~ %r{src='/images/email.png'}
+ assert body =~ %r{width='16'}
+ assert body =~ %r{height='16'}
+ end
+
+ test "img existing (production)" do
+ app.stubs(:development?).returns(false)
+ get '/helper/email'
+
+ assert body =~ %r{src='/images/email.[a-f0-9]{32}.png'}
assert body =~ %r{width='16'}
assert body =~ %r{height='16'}
end
test "css" do