premailer-rails3 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,9 +53,9 @@ module PremailerRails
53
53
  url = url[0..(url.index('?') - 1)] if url.include? '?'
54
54
  # Remove the host
55
55
  url = url.sub(/^https?\:\/\/[^\/]*/, '') if url.index('http') == 0
56
- else
57
- url
58
56
  end
57
+
58
+ url
59
59
  end
60
60
  end
61
61
  end
@@ -1,3 +1,3 @@
1
1
  module PremailerRails
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
@@ -35,9 +35,6 @@ describe PremailerRails::CSSHelper do
35
35
 
36
36
  context 'when HTML contains style tag' do
37
37
  let(:files) { [] }
38
- end
39
-
40
- context 'when HTML contains no linked CSS file' do
41
38
  let(:html) { Fixtures::HTML.with_style_block }
42
39
 
43
40
  it 'should not load the default file' do
@@ -49,6 +46,20 @@ describe PremailerRails::CSSHelper do
49
46
  css_for_doc(doc).should be_nil
50
47
  end
51
48
  end
49
+
50
+ context 'when HTML contains no linked CSS file nor style block tag' do
51
+ let(:files) { [] }
52
+ let(:html) { Fixtures::HTML.with_no_css_link }
53
+
54
+ it 'should load the default file' do
55
+ PremailerRails::CSSHelper \
56
+ .expects(:load_css) \
57
+ .with(:default) \
58
+ .returns('content of default css')
59
+
60
+ css_for_doc(doc).should == 'content of default css'
61
+ end
62
+ end
52
63
  end
53
64
 
54
65
  describe '#load_css' do
@@ -60,6 +71,14 @@ describe PremailerRails::CSSHelper do
60
71
  end
61
72
  end
62
73
 
74
+ context 'when path is a relative url' do
75
+ it 'should load the CSS at the local path' do
76
+ File.expects(:read).with('RAILS_ROOT/public/stylesheets/base.css')
77
+
78
+ load_css('/stylesheets/base.css?test')
79
+ end
80
+ end
81
+
63
82
  context 'when file is cached' do
64
83
  it 'should return the cached value' do
65
84
  cache = PremailerRails::CSSHelper.send(:instance_variable_get, '@cache')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: premailer-rails3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-22 00:00:00.000000000 Z
12
+ date: 2012-07-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: premailer