aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/attachment_to_html
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-04-02 17:15:41 +0100
committerGareth Rees <gareth@mysociety.org>2014-04-07 17:14:07 +0100
commit3954e78a4d330e3e9d82be0d239d5bf25d2f6a04 (patch)
tree2f2a031b3705396497862b7d29d1967481b55182 /spec/lib/attachment_to_html
parentcb06289e9fc04bf2ea9430828358a7cf304eae8f (diff)
Dynamically inject AttachmentToHTML::View content
Diffstat (limited to 'spec/lib/attachment_to_html')
-rw-r--r--spec/lib/attachment_to_html/attachment_to_html_spec.rb5
1 files changed, 5 insertions, 0 deletions
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 => '<p>prefix</p>' })
+ html.should include('<p>prefix</p>')
+ 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