iron_mailer 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,13 +12,15 @@ class IronMailer::SendEmail
|
|
12
12
|
|
13
13
|
if options['delivery_method'].is_a?(Hash)
|
14
14
|
delivery_method_hash = options['delivery_method']
|
15
|
+
@delivery_method=delivery_method_hash.keys.first.to_sym
|
16
|
+
@delivery_method_settings = {}
|
17
|
+
|
15
18
|
params = delivery_method_hash.values.first.clone
|
19
|
+
|
16
20
|
params.keys.each do |key|
|
17
|
-
|
21
|
+
@delivery_method_settings[key.to_sym] = params[key]
|
18
22
|
end
|
19
23
|
|
20
|
-
@delivery_method=delivery_method_hash.keys.first.to_sym
|
21
|
-
@delivery_method_settings = params
|
22
24
|
else
|
23
25
|
@delivery_method=options['delivery_method'].to_sym
|
24
26
|
@delivery_method_settings={}
|
@@ -50,7 +52,7 @@ class IronMailer::SendEmail
|
|
50
52
|
'date'=>mail.date,
|
51
53
|
'from'=>mail.from,
|
52
54
|
'to'=>mail.to,
|
53
|
-
'
|
55
|
+
'mail'=>mail.to_s
|
54
56
|
}
|
55
57
|
end
|
56
58
|
|
data/lib/iron_mailer/version.rb
CHANGED
@@ -151,7 +151,10 @@ describe IronMailer::SendEmail do
|
|
151
151
|
|
152
152
|
it "should add info about the email to the cache" do
|
153
153
|
@execute.should change(@send_email.cache, :size).by(1)
|
154
|
-
|
154
|
+
|
155
|
+
lambda{
|
156
|
+
JSON.parse(@send_email.cache.get(@test_email.message_id).value)
|
157
|
+
}.should_not raise_error
|
155
158
|
end
|
156
159
|
|
157
160
|
it "should call deliver with on the results of split_email" do
|
@@ -212,13 +215,8 @@ describe IronMailer::SendEmail do
|
|
212
215
|
@send_email.extract_cache_info(@test_email)['date'].should == @test_email.date
|
213
216
|
end
|
214
217
|
|
215
|
-
it "should
|
216
|
-
@send_email.extract_cache_info(@test_email)['
|
217
|
-
end
|
218
|
-
|
219
|
-
it "should extract the text_part if the text part is nil" do
|
220
|
-
@test_email.stub(:html_part).and_return(nil)
|
221
|
-
@send_email.extract_cache_info(@test_email)['content'].should == @test_email.text_part.body.to_s
|
218
|
+
it "should extract the content" do
|
219
|
+
@send_email.extract_cache_info(@test_email)['mail'].should == @test_email.to_s
|
222
220
|
end
|
223
221
|
end
|
224
222
|
|