absa-notify-me 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Absa
2
2
  module NotifyMe
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -56,7 +56,7 @@ module Absa
56
56
  }
57
57
  }
58
58
  end
59
- if key == :details
59
+ if (key == :details) && (!value.blank?)
60
60
  transactions = value[:transaction].blank? ? value["TRANSACTION"] : value[:transaction]
61
61
  transactions.each do |transaction|
62
62
  amount = (transaction[:amt].to_f * 100).to_i.to_s
@@ -3,8 +3,6 @@ require 'spec_helper'
3
3
  describe Absa::NotifyMe::XmlStatement do
4
4
 
5
5
  before(:each) do
6
- # @input_string = File.open("./spec/examples/test.xml", "rb").read
7
- # @hash = Absa::NotifyMe::XmlStatement.string_to_hash(@input_string)
8
6
  @hash = Absa::NotifyMe::XmlStatement.file_to_hash("./spec/examples/test.xml")
9
7
  end
10
8
 
@@ -29,4 +27,14 @@ describe Absa::NotifyMe::XmlStatement do
29
27
  :check_sum => "031A8EE087CFB656296FF93456B62639"}
30
28
  }
31
29
  end
30
+
31
+ context "Cater for an empty xml document" do
32
+ before(:each) do
33
+ @hash = Absa::NotifyMe::XmlStatement.file_to_hash("./spec/examples/empty_test.xml")
34
+ end
35
+
36
+ it "should not contain a detail record" do
37
+ @hash[:data][:data].select {|record| record[:type] == "detail"}.should be_blank
38
+ end
39
+ end
32
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: absa-notify-me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-18 00:00:00.000000000Z
12
+ date: 2012-06-25 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nori
16
- requirement: &70254756082060 !ruby/object:Gem::Requirement
16
+ requirement: &70241943610500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70254756082060
24
+ version_requirements: *70241943610500
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &70254756081640 !ruby/object:Gem::Requirement
27
+ requirement: &70241943610080 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70254756081640
35
+ version_requirements: *70241943610080
36
36
  description: ! "\n This is just a rapidly prototyped proof of concept gem for \n
37
37
  \ bankserv gem and those who can afford to use the ABSA NotifyMe \n Platform.
38
38
  \n \n For a production ready gem please rather use absa-esd with the \n bankserv