docdata 0.1.5 → 0.1.6

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: 583612f0f3405d88e304b04589e08faa14fc873c
4
- data.tar.gz: e846c3af8a8be9caec3bddb1ca375565feb9e7e3
3
+ metadata.gz: e4522413a11b26b3dfdfd86eba1c75266e2e75fd
4
+ data.tar.gz: 59ec267e42dc78db14c0ae8e24ff262198f14dc7
5
5
  SHA512:
6
- metadata.gz: 4f78048e064e074ffc7e343267d94b45b54d9ef81bbab5a34fd535466557f89746d80d23e3c027d195fa19388588c22a7305d374dd14b8df6c812b137fafcb82
7
- data.tar.gz: c039738e8915fa272fd01ea4c95e4e0df54f9823ba89febe6831f67a685f49018b68b8ee6594b930efc301188652b34701cda63a973039c4cf54a56e08e2fa97
6
+ metadata.gz: 6e7708006984099623dd4eb12229b6913285525705e3ac6e0b398e3a7626902896e5431f1f95afb745e97201da551c10bac842b0545b6027e1331671bd46a1a8
7
+ data.tar.gz: 3440473688ded10b3412bc588d3dc949beba30b2a0704123a0017af786b5582951124f4d64534494e608719927ba5674e1d5d4bba2669f978605559e14200e9a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## v0.1.6
2
+ * Bug fixed where a description contained an illegal character (& in this case)
3
+
1
4
  ## v0.1.5
2
5
  * Fixed a bug that occured when docdata reponded with multiple 'payment' nodes in the return object.
3
6
 
@@ -69,6 +69,12 @@ module Docdata
69
69
  end
70
70
 
71
71
 
72
+ # @return [String] a cleaned up version of the description string
73
+ # where forbidden characters are filtered out and limit is 50 chars.
74
+ def cleaned_up_description
75
+ description.gsub("&", "and")[0..49]
76
+ end
77
+
72
78
  # @return [Boolean] true/false, depending if this instanciated object is valid
73
79
  def valid?
74
80
  validator = PaymentValidator.new
@@ -1,3 +1,3 @@
1
1
  module Docdata
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -35,7 +35,7 @@
35
35
  </_1:billTo>
36
36
 
37
37
  <% if payment.description.present? %>
38
- <_1:description><%= payment.description[0..49] %></_1:description>
38
+ <_1:description><%= payment.cleaned_up_description %></_1:description>
39
39
  <% end %>
40
40
  <% if payment.receipt_text.present? %>
41
41
  <_1:receiptText><%= payment.receipt_text %></_1:receiptText>
@@ -89,7 +89,7 @@
89
89
  </_1:address>
90
90
  </_1:shipTo>
91
91
  <!--Optional:-->
92
- <_1:additionalDescription>sdf</_1:additionalDescription>
92
+ <_1:additionalDescription></_1:additionalDescription>
93
93
  </_1:invoice>
94
94
  <% end %>
95
95
 
data/spec/payment_spec.rb CHANGED
@@ -97,6 +97,12 @@ describe Docdata::Payment do
97
97
  expect(@response.payment).to be_kind_of(Docdata::Payment)
98
98
  end
99
99
 
100
+ it "replaces & for 'and'" do
101
+ @payment.description = "Pete & Friends"
102
+ expect(@payment.cleaned_up_description) == "Pete and Friends"
103
+ expect(@payment.create_xml).to include("Pete and Friends")
104
+ end
105
+
100
106
  it "has a `url` property" do
101
107
  Docdata.set_credentials_from_environment
102
108
  VCR.use_cassette("payments-successful-create") do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henk Meijer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-22 00:00:00.000000000 Z
12
+ date: 2014-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler