finapps 0.1.20.pre → 0.1.21.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/finapps/rest/client.rb +1 -1
- data/lib/finapps/utils/logging.rb +1 -1
- data/lib/finapps/utils/utils.rb +4 -2
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/client_spec.rb +44 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b55477908faa0ff988f7c1bb57e7672f4625f286
|
4
|
+
data.tar.gz: cf7b650bd07d90fcc662f62af3c2d5d1d0bd5ae3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b43f40c12592c65f9d5c9d9fa115fbc9e37978eb00bfb4bcd6c6af5b29caa192cb89619e2c3b47bc1d607cccbc504a1cda803be62b460cb0daafef195de9fa0
|
7
|
+
data.tar.gz: c8f461e3912ea7baea6df1aa26b45ecb40720233a5bff0cbc38f29fda8b292e575b1365798ec4f09f6ba10130f70e794e2ca51fffbf02919a6f6e0ccbc0dfc25
|
data/README.md
CHANGED
data/lib/finapps/rest/client.rb
CHANGED
@@ -5,7 +5,7 @@ module FinApps
|
|
5
5
|
include FinApps::Logging
|
6
6
|
include FinApps::REST::Connection
|
7
7
|
|
8
|
-
attr_reader :users, :institutions, :user_institutions, :accounts, :transactions
|
8
|
+
attr_reader :connection, :users, :institutions, :user_institutions, :accounts, :transactions
|
9
9
|
|
10
10
|
# @param [String] company_identifier
|
11
11
|
# @param [String] company_token
|
@@ -52,7 +52,7 @@ module FinApps
|
|
52
52
|
def skip_sensitive_data(hash)
|
53
53
|
if hash.is_a? Hash
|
54
54
|
redacted = hash.clone
|
55
|
-
redacted.update(redacted) { |key, v1| (PROTECTED_KEYS.include? key) ? '[REDACTED]' : v1 }
|
55
|
+
redacted.update(redacted) { |key, v1| (PROTECTED_KEYS.include? key.to_s.downcase) ? '[REDACTED]' : v1 }
|
56
56
|
else
|
57
57
|
hash
|
58
58
|
end
|
data/lib/finapps/utils/utils.rb
CHANGED
@@ -41,11 +41,13 @@ class Object
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
+
|
45
|
+
|
44
46
|
class Hash
|
45
47
|
def validate_required_strings!
|
46
48
|
self.each do |key, value|
|
47
|
-
raise MissingArgumentsError.new "Missing argument: #{key}." if value.blank?
|
48
|
-
raise InvalidArgumentsError.new "Invalid #{key} specified: #{value.inspect} must be a string or symbol." unless value.is_a?(String) || value.is_a?(Symbol)
|
49
|
+
raise FinApps::REST::MissingArgumentsError.new "Missing argument: #{key}." if value.blank?
|
50
|
+
raise FinApps::REST::InvalidArgumentsError.new "Invalid #{key} specified: #{value.inspect} must be a string or symbol." unless value.is_a?(String) || value.is_a?(Symbol)
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
data/lib/finapps/version.rb
CHANGED
data/spec/rest/client_spec.rb
CHANGED
@@ -9,6 +9,20 @@ module FinApps
|
|
9
9
|
@client = FinApps::REST::Client.new :company_identifier, :company_token
|
10
10
|
end
|
11
11
|
|
12
|
+
it 'responds to send' do
|
13
|
+
expect(@client).to respond_to(:send)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'responds to user_credentials!' do
|
17
|
+
expect(@client).to respond_to(:user_credentials!)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'responds to public api methods' do
|
21
|
+
[:connection, :users, :institutions, :user_institutions, :accounts, :transactions].each do |method|
|
22
|
+
expect(@client).to respond_to(method)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
12
26
|
describe '#new' do
|
13
27
|
context 'when company credentials are NOT provided' do
|
14
28
|
it 'should raise a MissingArgumentsError exception' do
|
@@ -18,7 +32,7 @@ module FinApps
|
|
18
32
|
|
19
33
|
context 'when company credentials are of invalid type' do
|
20
34
|
it 'should raise an InvalidArgumentsError exception' do
|
21
|
-
expect{FinApps::REST::Client.new 1, 2}.to raise_error(FinApps::REST::InvalidArgumentsError)
|
35
|
+
expect { FinApps::REST::Client.new 1, 2 }.to raise_error(FinApps::REST::InvalidArgumentsError)
|
22
36
|
end
|
23
37
|
end
|
24
38
|
|
@@ -29,15 +43,9 @@ module FinApps
|
|
29
43
|
end
|
30
44
|
end
|
31
45
|
|
32
|
-
describe '
|
33
|
-
it '
|
34
|
-
expect(@client).to
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe '#post' do
|
39
|
-
it 'responds to post' do
|
40
|
-
expect(@client).to respond_to(:post)
|
46
|
+
describe '.users' do
|
47
|
+
it 'returns a Users object' do
|
48
|
+
expect(@client.users).to be_an_instance_of(FinApps::REST::Users)
|
41
49
|
end
|
42
50
|
end
|
43
51
|
|
@@ -47,12 +55,36 @@ module FinApps
|
|
47
55
|
end
|
48
56
|
end
|
49
57
|
|
58
|
+
describe '.institutions' do
|
59
|
+
it 'returns an Institutions object' do
|
60
|
+
expect(@client.institutions).to be_an_instance_of(FinApps::REST::Institutions)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe '.user_institutions' do
|
65
|
+
it 'returns a UserInstitutions object' do
|
66
|
+
expect(@client.user_institutions).to be_an_instance_of(FinApps::REST::UserInstitutions)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe '.accounts' do
|
71
|
+
it 'returns a Accounts object' do
|
72
|
+
expect(@client.accounts).to be_an_instance_of(FinApps::REST::Accounts)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe '.transactions' do
|
77
|
+
it 'returns a Transactions object' do
|
78
|
+
expect(@client.transactions).to be_an_instance_of(FinApps::REST::Transactions)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
50
82
|
describe '#connection' do
|
51
83
|
it 'looks like Faraday connection' do
|
52
|
-
expect(@client.
|
84
|
+
expect(@client.connection).to respond_to(:run_request)
|
53
85
|
end
|
54
86
|
it 'memoizes the connection' do
|
55
|
-
c1, c2 = @client.
|
87
|
+
c1, c2 = @client.connection, @client.connection
|
56
88
|
expect(c1.object_id).to eq(c2.object_id)
|
57
89
|
end
|
58
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finapps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.21.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Quintero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|