Sha256: 60570ff0d39224235278bdb24563c4af0e7c54171d59100218c86bc6d5c808a4
Contents?: true
Size: 1.11 KB
Versions: 2
Compression:
Stored size: 1.11 KB
Contents
# coding: UTF-8 require 'spec_helper' describe PremailerRails::Premailer do [ :nokogiri, :hpricot ].each do |adapter| context "when adapter is #{adapter}" do before { ::Premailer::Adapter.stubs(:use).returns(adapter) } describe '#to_plain_text' do it 'should include the text from the HTML part' do premailer = PremailerRails::Premailer.new(Fixtures::Message::HTML_PART) premailer.to_plain_text.gsub(/\s/, ' ').strip \ .should == Fixtures::Message::TEXT_PART.gsub(/\s/, ' ').strip end end describe '#to_inline_css' do it 'should return the HTML with the CSS inlined' do PremailerRails::CSSHelper.stubs(:css_for_doc).returns('p { color: red; }') html = Fixtures::Message::HTML_PART premailer = PremailerRails::Premailer.new(html) premailer.to_inline_css.should include '<p style="color: red;">' end end end end describe '.new' do it 'should extract the CSS' do PremailerRails::CSSHelper.expects(:css_for_doc) PremailerRails::Premailer.new('some html') end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
premailer-rails3-1.0.1 | spec/premailer-rails3/premailer_spec.rb |
premailer-rails3-1.0.0 | spec/premailer-rails3/premailer_spec.rb |