require 'spec_helper' describe Premailer::Rails::Hook do def run_hook(message) Premailer::Rails::Hook.perform(message) end class Mail::Message def html_string (html_part || self).body.to_s end end let(:message) { Fixtures::Message.with_parts(:html) } let(:processed_message) { run_hook(message) } describe '.delivering_email' do it 'is an alias to .perform' do method = described_class.method(:delivering_email) expected_method = described_class.method(:perform) expect(method).to eq expected_method end end describe '.previewing_email' do it 'is an alias to .perform' do method = described_class.method(:previewing_email) expected_method = described_class.method(:perform) expect(method).to eq expected_method end end it 'inlines the CSS' do expect { run_hook(message) }.to \ change { message.html_string.include?("