ficonabses 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ficonabses/base.rb +7 -1
- data/test/test_ficonabses.rb +2 -2
- data/test/test_localhost.rb +22 -0
- metadata +3 -2
data/lib/ficonabses/base.rb
CHANGED
@@ -10,6 +10,12 @@ module FiconabSES
|
|
10
10
|
attr_accessor :host,:account,:password,:uri,:clnt,:extheader
|
11
11
|
|
12
12
|
@@host= 'ses.sg.estormtech.com'
|
13
|
+
def set_debug
|
14
|
+
@@host= 'localhost:8083'
|
15
|
+
end
|
16
|
+
def host
|
17
|
+
@@host
|
18
|
+
end
|
13
19
|
# @@host= 'localhost:8083'
|
14
20
|
def self.send_textemail(account,password,destination,subject,contents)
|
15
21
|
f=FiconabSES::Base.new
|
@@ -44,7 +50,7 @@ module FiconabSES
|
|
44
50
|
end
|
45
51
|
def html_url(destination,subject,contents,html)
|
46
52
|
contents='' if contents==nil
|
47
|
-
url="#{self.text_url(destination,subject,contents)}&html=#{URI.encode(
|
53
|
+
url="#{self.text_url(destination,subject,contents)}&html=#{URI.encode(html)}"
|
48
54
|
end
|
49
55
|
def send_textemail(account,password,destination,subject,contents)
|
50
56
|
url=self.text_url(destination,subject,contents)
|
data/test/test_ficonabses.rb
CHANGED
@@ -11,12 +11,12 @@ class TestFiconabses < Test::Unit::TestCase
|
|
11
11
|
assert res.include? '200'
|
12
12
|
end
|
13
13
|
def test_send_html
|
14
|
-
res =FiconabSES::Base.send_htmlemail('scott','scott123','scott.sproule@gmail.com','This is the subject','<h1>HTML Contents</h1><p>hi from paragraph</p>','text contents of the email')
|
14
|
+
res =FiconabSES::Base.send_htmlemail('scott','scott123','scott.sproule@gmail.com','This is the HTML subject','<h1>HTML Contents</h1><p>hi from paragraph</p>','text contents of the email')
|
15
15
|
puts "RES is: #{res}"
|
16
16
|
assert res.include? '200'
|
17
17
|
end
|
18
18
|
def test_send_html_nil_text
|
19
|
-
res =FiconabSES::Base.send_htmlemail('scott','scott123','scott.sproule@gmail.com','This is
|
19
|
+
res =FiconabSES::Base.send_htmlemail('scott','scott123','scott.sproule@gmail.com','This is HTML Subject nil text','<h1>HTML Contents</h1><p>hi from paragraph</p>') #no text portion
|
20
20
|
puts "RES is: #{res}"
|
21
21
|
assert res.include? '200'
|
22
22
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestFiconabses < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@f=FiconabSES::Base.new
|
7
|
+
@f.set_debug
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_local_send_text
|
11
|
+
res= @f.send_textemail('scott','scott123','scott.sproule@gmail.com',"'LOCALHOST': #{@f.host}",'contents of the email')
|
12
|
+
puts "RES is: #{res}"
|
13
|
+
assert res.include? '200'
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_local_send_html
|
17
|
+
res =@f.send_htmlemail('scott','scott123','scott.sproule@gmail.com',"'HTML:LOCALHOST': #{@f.host}",'<h1>HTML Contents</h1><p>hi from paragraph</p>','text contents of the email')
|
18
|
+
puts "RES is: #{res}"
|
19
|
+
assert res.include? '200'
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Scott Sproule
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- lib/ficonabses.rb
|
32
32
|
- test/test_ficonabses.rb
|
33
33
|
- test/test_helper.rb
|
34
|
+
- test/test_localhost.rb
|
34
35
|
- History.txt
|
35
36
|
- Manifest.txt
|
36
37
|
- PostInstall.txt
|