mad_mimi_two 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mad_mimi_two/mad_mimi_mailer.rb +3 -2
- data/test/test_mad_mimi_two.rb +0 -44
- metadata +4 -16
@@ -24,6 +24,7 @@ module MadMimiTwo
|
|
24
24
|
def send_cmd(url)
|
25
25
|
begin
|
26
26
|
client= HTTPClient.new
|
27
|
+
client.timeout(60)
|
27
28
|
res=client.get_content(url)
|
28
29
|
rescue HTTPClient::BadResponseError
|
29
30
|
res="problem retrieving status: #{res.inspect}"
|
@@ -69,9 +70,9 @@ module MadMimiTwo
|
|
69
70
|
end
|
70
71
|
def get_promotions
|
71
72
|
res={'select promotion'=>'select promotion'}
|
72
|
-
1.upto(5) { |i| #only up to three pages now
|
73
|
-
#puts "i is #{i}"
|
73
|
+
1.upto(5) { |i| #only up to three pages now
|
74
74
|
tmp=get_promotions_internal(i)
|
75
|
+
puts "i is #{i} tmp size is #{tmp.size}"
|
75
76
|
break if tmp.empty?
|
76
77
|
res= res.merge(tmp)
|
77
78
|
}
|
data/test/test_mad_mimi_two.rb
CHANGED
@@ -68,27 +68,6 @@ class TestMadMimiTwo < Test::Unit::TestCase
|
|
68
68
|
email_placeholders thash # :user => tuser, :url => turl
|
69
69
|
content_type "text/html"
|
70
70
|
end
|
71
|
-
r=t.deliver_mimi_message
|
72
|
-
puts "result: #{r} message: #{t.inspect}"
|
73
|
-
assert t.headers.size==0, "headers not empty"
|
74
|
-
assert t[:to].to_s=='scott.sproule@ficonab.com', "to person not correct #{t[:to]}"
|
75
|
-
assert t.promotion.to_s=='new_crm', 'promotion first wrong'
|
76
|
-
#assert t[:promotion].to_s=='new_crm', 'promotion wrong'
|
77
|
-
end
|
78
|
-
def test_reply_to # PLEASE NOTE THAT YOUR MAD MIMI ACCOUNT NEEDS PROMOTION CALLED new_crm accepting user and url
|
79
|
-
thash={:user => 'test', :url => 'test.estormtech.com' }
|
80
|
-
t=MadMimiTwo::MadMimiMessage.new do
|
81
|
-
subject 'email from test case: test_reply_to'
|
82
|
-
to 'scott.sproule@ficonab.com'
|
83
|
-
reply_to 'scott reply <scott.sproule@ficonab.com>'
|
84
|
-
# cc admin
|
85
|
-
promotion 'new_crm'
|
86
|
-
from 'support@estormtech.com'
|
87
|
-
bcc ["scott.sproule@estormtech.com", "eka.mardiarti@estormtech.com"]
|
88
|
-
# sent_on Time.now
|
89
|
-
email_placeholders thash # :user => tuser, :url => turl
|
90
|
-
content_type "text/html"
|
91
|
-
end
|
92
71
|
# t.email_placeholders(thash)
|
93
72
|
r=t.deliver_mimi_message
|
94
73
|
puts "result: #{r} message: #{t.inspect}"
|
@@ -106,27 +85,4 @@ class TestMadMimiTwo < Test::Unit::TestCase
|
|
106
85
|
assert r=='sent', "message response not correct: #{r}"
|
107
86
|
|
108
87
|
end
|
109
|
-
def test_email_address
|
110
|
-
t=MadMimiTwo::MadMimiMessage.new
|
111
|
-
r=t.add_email('driplisttest',"ttt@email2.com")
|
112
|
-
puts "add email list: 'r is ' #{r}"
|
113
|
-
## assert r.key?('testlist'), "does not include testlist #{r}"
|
114
|
-
#this MAY NOT BE IN YOUR promotions list
|
115
|
-
end
|
116
|
-
def test_get_audience_list
|
117
|
-
t=MadMimiTwo::MadMimiMessage.new
|
118
|
-
r=t.get_lists()
|
119
|
-
puts "audience list: 'r is ' #{r}"
|
120
|
-
assert r.class==Hash, "response is not Hash r is: #{r} #{r.class}"
|
121
|
-
assert r.key?('testlist'), "does not include testlist #{r}"
|
122
|
-
#this MAY NOT BE IN YOUR promotions list
|
123
|
-
end
|
124
|
-
def test_get_promotions
|
125
|
-
t=MadMimiTwo::MadMimiMessage.new
|
126
|
-
r=t.get_promotions()
|
127
|
-
puts "'r is ' #{r}"
|
128
|
-
assert r.class==Hash, "response is not Hash r is: #{r} #{r.class}"
|
129
|
-
assert r.key?('new_CRM'), "does not include new_CRM #{r}" #this MAY NOT BE IN YOUR promotions list
|
130
|
-
|
131
|
-
end
|
132
88
|
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mad_mimi_two
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
8
|
+
- 9
|
9
|
+
version: 0.6.9
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- scott sproule
|
@@ -22,11 +21,9 @@ dependencies:
|
|
22
21
|
name: rubyforge
|
23
22
|
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
24
|
requirements:
|
27
25
|
- - ">="
|
28
26
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 9
|
30
27
|
segments:
|
31
28
|
- 2
|
32
29
|
- 0
|
@@ -38,11 +35,9 @@ dependencies:
|
|
38
35
|
name: hoe
|
39
36
|
prerelease: false
|
40
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
38
|
requirements:
|
43
39
|
- - ">="
|
44
40
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 23
|
46
41
|
segments:
|
47
42
|
- 2
|
48
43
|
- 6
|
@@ -78,9 +73,6 @@ files:
|
|
78
73
|
- script/generate
|
79
74
|
- test/test_helper.rb
|
80
75
|
- test/test_mad_mimi_two.rb
|
81
|
-
- bin/send_mimi.rb
|
82
|
-
- bin/check_mimi_status.rb
|
83
|
-
- bin/add_to_list.rb
|
84
76
|
has_rdoc: true
|
85
77
|
homepage: http://github.com/semdinsp/mad_mimi_two
|
86
78
|
licenses: []
|
@@ -94,27 +86,23 @@ rdoc_options:
|
|
94
86
|
require_paths:
|
95
87
|
- lib
|
96
88
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
89
|
requirements:
|
99
90
|
- - ">="
|
100
91
|
- !ruby/object:Gem::Version
|
101
|
-
hash: 3
|
102
92
|
segments:
|
103
93
|
- 0
|
104
94
|
version: "0"
|
105
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
96
|
requirements:
|
108
97
|
- - ">="
|
109
98
|
- !ruby/object:Gem::Version
|
110
|
-
hash: 3
|
111
99
|
segments:
|
112
100
|
- 0
|
113
101
|
version: "0"
|
114
102
|
requirements: []
|
115
103
|
|
116
104
|
rubyforge_project: mad_mimi_two
|
117
|
-
rubygems_version: 1.6
|
105
|
+
rubygems_version: 1.3.6
|
118
106
|
signing_key:
|
119
107
|
specification_version: 3
|
120
108
|
summary: Using Mad Mimi on rails 3
|