Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'strip-digest'

  • Loading branch information...
commit ae6136dd77a16b9fdb4fc39de0f0acc8b0692e7e 2 parents 906d22b + f4f8bfc
Philipe Fatio authored February 27, 2012
3  lib/premailer-rails3/css_helper.rb
@@ -33,7 +33,8 @@ def load_css_at_path(path)
33 33
             file = if path == :default
34 34
                      'email.css'
35 35
                    else
36  
-                     path.sub("#{Rails.configuration.assets.prefix}/", '')
  36
+                     path.sub("#{Rails.configuration.assets.prefix}/", '') \
  37
+                         .sub(/-.*\.css$/, '.css')
37 38
                    end
38 39
             if asset = Rails.application.assets.find_asset(file)
39 40
               asset.to_s
11  spec/premailer-rails3/css_helper_spec.rb
@@ -129,6 +129,17 @@ def css_for_doc(doc)
129 129
         load_css_at_path('http://example.com/assets/base.css') \
130 130
           .should == 'content of base.css'
131 131
       end
  132
+
  133
+      it 'should return same file when path contains file fingerprint' do
  134
+        Rails.application.assets \
  135
+                         .expects(:find_asset) \
  136
+                         .with('base.css') \
  137
+                         .returns(mock(:to_s => 'content of base.css'))
  138
+
  139
+        load_css_at_path(
  140
+          'http://example.com/assets/base-089e35bd5d84297b8d31ad552e433275.css'
  141
+        ).should == 'content of base.css'
  142
+      end
132 143
     end
133 144
 
134 145
     context 'when static stylesheets are used' do

0 notes on commit ae6136d

Please sign in to comment.
Something went wrong with that request. Please try again.