From 3954e78a4d330e3e9d82be0d239d5bf25d2f6a04 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 2 Apr 2014 17:15:41 +0100 Subject: Dynamically inject AttachmentToHTML::View content --- spec/lib/attachment_to_html/attachment_to_html_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spec/lib/attachment_to_html') diff --git a/spec/lib/attachment_to_html/attachment_to_html_spec.rb b/spec/lib/attachment_to_html/attachment_to_html_spec.rb index 41e1d67e5..1cf7debb7 100644 --- a/spec/lib/attachment_to_html/attachment_to_html_spec.rb +++ b/spec/lib/attachment_to_html/attachment_to_html_spec.rb @@ -18,6 +18,11 @@ describe AttachmentToHTML do to_html(attachment).should == expected end + it 'passes content injections options when rendering the result' do + html = to_html(attachment, :content_for => { :body_prefix => '

prefix

' }) + html.should include('

prefix

') + end + it 'accepts a hash of options to pass to the adapter' do options = { :wrapper => 'wrap' } AttachmentToHTML::Adapters::Text.should_receive(:new).with(attachment, options).and_call_original -- cgit v1.2.3