apruve 2.0.5 → 2.0.6
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/Gemfile.lock +2 -7
- data/lib/apruve/resources/corporate_account.rb +5 -0
- data/lib/apruve/version.rb +1 -1
- data/spec/apruve/resources/corporate_account_spec.rb +26 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6fa23f2a28b8e0901a0898df628efc50f44469d
|
4
|
+
data.tar.gz: afae137c2ac6b25445a389a399c120da8d759c43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afc223752d953528208e9aa6cd9d3c6da43cb1add60280e8a02b58f12e4dc12490bcced290e36fa380ba1ecb00538d9f43376f03dd243fd374a642d40b74be95
|
7
|
+
data.tar.gz: 0ce28b2d3b55e208e1fb36dca62d87f5b00b79b27d0eb90bb8f4dd61c0e436858f0dc53a6b6e8bac5454b85645822416312f0c39536938de3ef213670c8f4baa
|
data/Gemfile.lock
CHANGED
@@ -34,7 +34,7 @@ GEM
|
|
34
34
|
guard (>= 1.1)
|
35
35
|
rspec (~> 2.11)
|
36
36
|
i18n (0.6.9)
|
37
|
-
json (1.8.
|
37
|
+
json (1.8.6)
|
38
38
|
listen (1.3.1)
|
39
39
|
rb-fsevent (>= 0.9.3)
|
40
40
|
rb-inotify (>= 0.9)
|
@@ -51,11 +51,6 @@ GEM
|
|
51
51
|
coderay (~> 1.1.0)
|
52
52
|
method_source (~> 0.8.1)
|
53
53
|
slop (~> 3.4)
|
54
|
-
pry (0.10.0-i386-mingw32)
|
55
|
-
coderay (~> 1.1.0)
|
56
|
-
method_source (~> 0.8.1)
|
57
|
-
slop (~> 3.4)
|
58
|
-
win32console (~> 1.3)
|
59
54
|
pry (0.10.0-x86-mingw32)
|
60
55
|
coderay (~> 1.1.0)
|
61
56
|
method_source (~> 0.8.1)
|
@@ -130,4 +125,4 @@ DEPENDENCIES
|
|
130
125
|
yard
|
131
126
|
|
132
127
|
BUNDLED WITH
|
133
|
-
1.16.
|
128
|
+
1.16.6
|
@@ -17,5 +17,10 @@ module Apruve
|
|
17
17
|
response = Apruve.get("merchants/#{merchant_id}/corporate_accounts")
|
18
18
|
response.body.map { |ca| CorporateAccount.new(ca.empty? ? {} : ca) }
|
19
19
|
end
|
20
|
+
|
21
|
+
def self.find_by_uuid(merchant_id, uuid)
|
22
|
+
response = Apruve.get("merchants/#{merchant_id}/corporate_accounts/#{uuid}")
|
23
|
+
CorporateAccount.new response.body
|
24
|
+
end
|
20
25
|
end
|
21
26
|
end
|
data/lib/apruve/version.rb
CHANGED
@@ -96,4 +96,30 @@ describe Apruve::CorporateAccount do
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
99
|
+
|
100
|
+
describe '#find_by_uuid' do
|
101
|
+
context 'successful response' do
|
102
|
+
let! (:stubs) do
|
103
|
+
faraday_stubs do |stub|
|
104
|
+
stub.get("/api/v4/merchants/#{merchant_uuid}/corporate_accounts/#{id}") { [200, {} , '{}'] }
|
105
|
+
end
|
106
|
+
end
|
107
|
+
it 'should return the corporate account' do
|
108
|
+
Apruve::CorporateAccount.find_by_uuid(merchant_uuid, id)
|
109
|
+
stubs.verify_stubbed_calls
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
context 'when not found' do
|
114
|
+
let! (:stubs) do
|
115
|
+
faraday_stubs do |stub|
|
116
|
+
stub.get("/api/v4/merchants/#{merchant_uuid}/corporate_accounts/#{id}") { [404, {} , 'Not Found'] }
|
117
|
+
end
|
118
|
+
end
|
119
|
+
it 'should raise not found' do
|
120
|
+
expect { Apruve::CorporateAccount.find_by_uuid(merchant_uuid, id) }.to raise_error(Apruve::NotFound)
|
121
|
+
stubs.verify_stubbed_calls
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
99
125
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apruve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Apruve, Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
165
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.
|
166
|
+
rubygems_version: 2.5.2.3
|
167
167
|
signing_key:
|
168
168
|
specification_version: 4
|
169
169
|
summary: Helper library for integrating Apruve into a ruby app.
|