sms_box 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91354a659de5fdd4d98e73dbc1694bd6c6d6794a
4
- data.tar.gz: ca6ba8e8096ab84a75a4620d3dce0d0bbbe8a280
3
+ metadata.gz: ca3dec10595b8a4b19bba996b0dc71556765eb6d
4
+ data.tar.gz: d57871339cb17a7fcd3a73e397f0e40a6fffff30
5
5
  SHA512:
6
- metadata.gz: fe56ffb54de11a8b4ab01492573998a986bfb3b16a4ee947490f7942a2cc53d92d5cb862b547c6d5b7d5fa5faae1681c242bac0799916b831e380d935dc85d15
7
- data.tar.gz: a56137e6b2d7d4c683c977bd9d15ab302f11cb66ce593e92fbfa8bb400183f5abf1c61a1e3cabfd0d5bc3f10a6426ef0f829a1e98f035a1a0d424eac4ea4c6af
6
+ metadata.gz: 8ffd3cb51df9ccb262f169935d90edcf9e84b6999860006bc73fcf58c7631e07c9c6b576f803540c593b27bd1fa3a82a2d9a9d9427a4e8b872a74e15ed5d81aa
7
+ data.tar.gz: 8350f77219e6df26499f9cf0ad3137caa7ff29fa739be46542c0aef31235604a39998d07f4b440f86b2e9452c626ae15ca2f59f295c8fd67b4d84ab7c356686e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.2.0 - 2013.05.01
4
+
5
+ * WebsendRequest: Support maximumSMSAmount
6
+
3
7
  ## v0.1.0 - 2013.05.01
4
8
 
5
9
  * Generic XMLRequest and XMLResponse implementation
@@ -1,3 +1,3 @@
1
1
  module SMSBox
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -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|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sms_box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian de Castelberg