-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathtemplate_spec.rb
36 lines (24 loc) · 1.17 KB
/
template_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'spec_helper'
describe SparkPostRails::DeliveryMethod do
before(:each) do
@delivery_method = SparkPostRails::DeliveryMethod.new
end
context "Templates" do
it "accepts the template id to use" do
test_email = Mailer.test_email sparkpost_data: {template_id: "test_template"}
@delivery_method.deliver!(test_email)
expect(@delivery_method.data[:content][:template_id]).to eq("test_template")
end
it "does not include inline content elements" do
test_email = Mailer.test_email sparkpost_data: {template_id: "test_template"}
@delivery_method.deliver!(test_email)
expect(@delivery_method.data[:content].has_key?(:from)).to eq(false)
expect(@delivery_method.data[:content].has_key?(:reply_to)).to eq(false)
expect(@delivery_method.data[:content].has_key?(:subject)).to eq(false)
expect(@delivery_method.data[:content].has_key?(:html)).to eq(false)
expect(@delivery_method.data[:content].has_key?(:text)).to eq(false)
expect(@delivery_method.data[:content].has_key?(:attachments)).to eq(false)
expect(@delivery_method.data[:content].has_key?(:inline_images)).to eq(false)
end
end
end