sms_gateway 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sms_gateway/adapters/sms_trade.rb +1 -0
- data/lib/sms_gateway/base.rb +1 -1
- data/lib/sms_gateway/version.rb +1 -1
- data/test/adapters/sms_trade_test.rb +6 -5
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03a54a6eeddebf3a65ff4cbcc689f7516332bd0f
|
4
|
+
data.tar.gz: d22ce1156c432c0fe8a44df5696911c6d60cb0b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbd74262c9f4396b08d34e725da84a4919f78f850e97e42881555659a601e808c3afca681b7dd0c967c4602608515059f5c343e475fdcc1ae7e9e0d9d459eb46
|
7
|
+
data.tar.gz: 228739afcdaa6b13a52e91edc3b3ad298a8f259ef879e601c9bf73881e80bbe199da50f47ca48186f916d252023fe09b2243c2d4fd75ba3be8841342d977effd
|
@@ -10,6 +10,7 @@ module SmsGateway
|
|
10
10
|
def initialize(config={})
|
11
11
|
@config = {:key => SmsGateway::Base.key, :from => SmsGateway::Base.from, :route => SmsGateway::Base.route}
|
12
12
|
@config.merge!(config)
|
13
|
+
self.class.base_uri SmsGateway::Base.base_uri
|
13
14
|
end
|
14
15
|
|
15
16
|
def send_sms(sms)
|
data/lib/sms_gateway/base.rb
CHANGED
data/lib/sms_gateway/version.rb
CHANGED
@@ -7,7 +7,8 @@ describe SmsGateway::Adapters::SmsGlobal do
|
|
7
7
|
:adapter => 'sms_trade',
|
8
8
|
:route => 'direct',
|
9
9
|
:key => 'KEY',
|
10
|
-
:from => 'SMSTRADE'
|
10
|
+
:from => 'SMSTRADE',
|
11
|
+
:base_uri => 'http://gateway.smspromote.de'
|
11
12
|
}
|
12
13
|
end
|
13
14
|
|
@@ -15,24 +16,24 @@ describe SmsGateway::Adapters::SmsGlobal do
|
|
15
16
|
|
16
17
|
sms = SmsGateway::Sms.new(:to => '491701234567', :text => "Hallö Ümläut.", :from => 'SENDER')
|
17
18
|
|
18
|
-
stub_request(:get, "http://gateway.
|
19
|
+
stub_request(:get, "http://gateway.smspromote.de/?charset=UTF-8&from=SENDER&key=KEY&message=#{URI.encode(sms.text)}&route=direct&to=491701234567").
|
19
20
|
to_return(:status => 200, :body => "", :headers => {})
|
20
21
|
|
21
22
|
sms.deliver
|
22
23
|
|
23
|
-
assert_requested(:get, "http://gateway.
|
24
|
+
assert_requested(:get, "http://gateway.smspromote.de/?key=KEY&to=491701234567&message=#{URI.encode(sms.text)}&route=direct&from=SENDER&charset=UTF-8")
|
24
25
|
end
|
25
26
|
|
26
27
|
it 'allows changing the route on the fly' do
|
27
28
|
|
28
29
|
sms = SmsGateway::Sms.new(:to => '491701234567', :text => "SMSTEXT", :from => 'SENDER', :route => 'basic')
|
29
30
|
|
30
|
-
stub_request(:get, "http://gateway.
|
31
|
+
stub_request(:get, "http://gateway.smspromote.de/?charset=UTF-8&from=SENDER&key=KEY&message=#{URI.encode(sms.text)}&route=basic&to=491701234567").
|
31
32
|
to_return(:status => 200, :body => "", :headers => {})
|
32
33
|
|
33
34
|
sms.deliver
|
34
35
|
|
35
|
-
assert_requested(:get, "http://gateway.
|
36
|
+
assert_requested(:get, "http://gateway.smspromote.de/?key=KEY&to=491701234567&message=#{URI.encode(sms.text)}&route=basic&from=SENDER&charset=UTF-8")
|
36
37
|
|
37
38
|
end
|
38
39
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sms_gateway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kai Rubarth
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -134,4 +134,9 @@ rubygems_version: 2.2.2
|
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: Simple and flexible interface to SMS Gateways
|
137
|
-
test_files:
|
137
|
+
test_files:
|
138
|
+
- test/adapters/sms_global_test.rb
|
139
|
+
- test/adapters/sms_trade_test.rb
|
140
|
+
- test/adapters/test_adapter_test.rb
|
141
|
+
- test/configuration_test.rb
|
142
|
+
- test/test_helper.rb
|