mad_mimi_two 0.0.6 → 0.1.0
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.
- data/README.rdoc +1 -1
- data/test/test_mad_mimi_two.rb +26 -4
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -18,7 +18,7 @@ All of the terrible stuff is by me. Apologies for taking an elegant solution an
|
|
18
18
|
* FIX (list of features or problems)
|
19
19
|
This has only been tested on Ruby 1.8.7.
|
20
20
|
Testing on Ruby 1.9 required.
|
21
|
-
Currently tested and working with rails 3 beta
|
21
|
+
Currently tested and working with rails 3 beta and Rails 2 (same code works)
|
22
22
|
|
23
23
|
|
24
24
|
== SYNOPSIS:
|
data/test/test_mad_mimi_two.rb
CHANGED
@@ -14,7 +14,9 @@ class TestMadMimiTwo < Test::Unit::TestCase
|
|
14
14
|
puts t.inspect
|
15
15
|
assert t.headers.size==0, "headers not empty"
|
16
16
|
end
|
17
|
-
def
|
17
|
+
def test_header
|
18
|
+
test="hello there"
|
19
|
+
hashv={ :body => test, :user => 'string'}
|
18
20
|
t=MadMimiTwo::MadMimiMessage.new do
|
19
21
|
subject 'tsubj test subject'
|
20
22
|
to 'scott.sproule@ficonab.com'
|
@@ -23,13 +25,33 @@ class TestMadMimiTwo < Test::Unit::TestCase
|
|
23
25
|
from 'support@estormtech.com'
|
24
26
|
bcc ["scott.sproule@estormtech.com", "eka.mardiarti@estormtech.com"]
|
25
27
|
# sent_on Time.now
|
26
|
-
|
28
|
+
email_placeholders hashv # :user => tuser, :url => turl
|
27
29
|
content_type "text/html"
|
28
30
|
end
|
29
31
|
puts t.inspect
|
30
32
|
assert t.headers.size==0, "headers not empty"
|
31
33
|
assert t[:to].to_s=='scott.sproule@ficonab.com', "to person not correct #{t[:to]}"
|
32
34
|
assert t.promotion.to_s=='new_crm', 'promotion first wrong'
|
35
|
+
assert t.email_placeholders.has_key?(:body), "placeholders seem wrong #{t.email_placeholders}"
|
36
|
+
assert t.email_placeholders.value?("hello there"), "placeholders seem wrong #{t.email_placeholders}"
|
37
|
+
#assert t[:promotion].to_s=='new_crm', 'promotion wrong'
|
38
|
+
end
|
39
|
+
def test_header_setup2
|
40
|
+
test="hello there"
|
41
|
+
t=MadMimiTwo::MadMimiMessage.new do
|
42
|
+
subject 'tsubj test subject'
|
43
|
+
to 'scott.sproule@ficonab.com'
|
44
|
+
# cc admin
|
45
|
+
promotion 'new_crm'
|
46
|
+
from 'support@estormtech.com'
|
47
|
+
bcc ["scott.sproule@estormtech.com", "eka.mardiarti@estormtech.com"]
|
48
|
+
# sent_on Time.now
|
49
|
+
email_placeholders :body => test, :user => 'string'
|
50
|
+
content_type "text/html"
|
51
|
+
end
|
52
|
+
puts t.inspect
|
53
|
+
assert t.email_placeholders.has_key?(:body), "placeholders seem wrong #{t.email_placeholders}"
|
54
|
+
assert t.email_placeholders.value?("hello there"), "placeholders seem wrong #{t.email_placeholders}"
|
33
55
|
#assert t[:promotion].to_s=='new_crm', 'promotion wrong'
|
34
56
|
end
|
35
57
|
def test_sending_mesage
|
@@ -47,7 +69,7 @@ class TestMadMimiTwo < Test::Unit::TestCase
|
|
47
69
|
end
|
48
70
|
# t.email_placeholders(thash)
|
49
71
|
r=t.deliver_mimi_message
|
50
|
-
puts "result: #{r} message: t.inspect"
|
72
|
+
puts "result: #{r} message: #{t.inspect}"
|
51
73
|
assert t.headers.size==0, "headers not empty"
|
52
74
|
assert t[:to].to_s=='scott.sproule@ficonab.com', "to person not correct #{t[:to]}"
|
53
75
|
assert t.promotion.to_s=='new_crm', 'promotion first wrong'
|
@@ -59,7 +81,7 @@ class TestMadMimiTwo < Test::Unit::TestCase
|
|
59
81
|
r=t.check_status('1159748168')
|
60
82
|
puts "'r is ' #{r}"
|
61
83
|
assert r.class==String, "response is not string r is: #{r} #{r.class}"
|
62
|
-
assert r=='
|
84
|
+
assert r=='sent', "message response not correct: #{r}"
|
63
85
|
|
64
86
|
end
|
65
87
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mad_mimi_two
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.6
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Scott Sproule
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-05-
|
18
|
+
date: 2010-05-26 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|