sms_box 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sms_box/version.rb +1 -1
- data/lib/sms_box/websend_request.rb +4 -0
- data/spec/unit/sms_box/websend_request_spec.rb +29 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca3dec10595b8a4b19bba996b0dc71556765eb6d
|
4
|
+
data.tar.gz: d57871339cb17a7fcd3a73e397f0e40a6fffff30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ffd3cb51df9ccb262f169935d90edcf9e84b6999860006bc73fcf58c7631e07c9c6b576f803540c593b27bd1fa3a82a2d9a9d9427a4e8b872a74e15ed5d81aa
|
7
|
+
data.tar.gz: 8350f77219e6df26499f9cf0ad3137caa7ff29fa739be46542c0aef31235604a39998d07f4b440f86b2e9452c626ae15ca2f59f295c8fd67b4d84ab7c356686e
|
data/CHANGELOG.md
CHANGED
data/lib/sms_box/version.rb
CHANGED
@@ -7,6 +7,7 @@ module SMSBox
|
|
7
7
|
attr_accessor :service
|
8
8
|
attr_accessor :text
|
9
9
|
attr_accessor :receivers
|
10
|
+
attr_accessor :maximum_sms_amount
|
10
11
|
|
11
12
|
def initialize
|
12
13
|
self.receivers = []
|
@@ -25,6 +26,9 @@ module SMSBox
|
|
25
26
|
end
|
26
27
|
parameters.service service
|
27
28
|
parameters.text_ text
|
29
|
+
if maximum_sms_amount.present?
|
30
|
+
parameters.maximumSMSAmount maximum_sms_amount
|
31
|
+
end
|
28
32
|
end
|
29
33
|
xml
|
30
34
|
end
|
@@ -36,6 +36,35 @@ module SMSBox
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
describe '#decorate_xml' do
|
40
|
+
let :request do
|
41
|
+
WebsendRequest.new
|
42
|
+
end
|
43
|
+
|
44
|
+
let :decorated_xml do
|
45
|
+
Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
|
46
|
+
request.decorate_xml(xml)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context 'with maximum_sms_amount set' do
|
51
|
+
it 'adds maximumSMSAmount node' do
|
52
|
+
decorated_xml.doc.css(
|
53
|
+
'SMSBoxXMLRequest > parameters > maximumSMSAmount'
|
54
|
+
).should be_empty
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context 'without maximum_sms_amount set' do
|
59
|
+
it 'does not add maximumSMSAmount node' do
|
60
|
+
request.maximum_sms_amount = 10
|
61
|
+
decorated_xml.doc.css(
|
62
|
+
'SMSBoxXMLRequest > parameters > maximumSMSAmount'
|
63
|
+
)[0].text.should == "10"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
39
68
|
describe '#to_xml' do
|
40
69
|
let :request do
|
41
70
|
WebsendRequest.new.tap do |r|
|