finicity 0.1.0 → 0.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b098f2e47f9c53c1f98d3a78f144b88aa3c1de2
|
4
|
+
data.tar.gz: da0f3715ebe1058bc3aca43e8b23826dfc55c4e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3932de91e2a85786bf99a602ac765bfb6e07a816cf66fd2a094f20725442626b95c9378ca3cace828d45efd7e82ee20d9d2637abc0eb1d3d4e9915525d722e44
|
7
|
+
data.tar.gz: a648e639ccda88f0d3fab206438b08c468cdf975023343a31a27011a9bfac6f82f4ebd126f064001dee40775b847eab82442fac8b2d79d3ee7e0c8729bd8ebdc
|
data/lib/finicity/client.rb
CHANGED
@@ -146,6 +146,8 @@ module Finicity
|
|
146
146
|
if response.ok?
|
147
147
|
parsed_response = ::Finicity::V1::Response::Accounts.parse(response.body)
|
148
148
|
return parsed_response.accounts
|
149
|
+
elsif response.status_code == 404
|
150
|
+
return []
|
149
151
|
else
|
150
152
|
raise_generic_error!(response)
|
151
153
|
end
|
data/lib/finicity/version.rb
CHANGED
@@ -3,6 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe ::Finicity::Client do
|
4
4
|
let(:mfa_session_token) { 'mfa-123' }
|
5
5
|
let(:response) { instance_double(::HTTP::Message, :ok? => true, :status_code => 200, :body => "hello") }
|
6
|
+
let(:not_found) { instance_double(::HTTP::Message, :ok? => false, :status_code => 404, :body => "not found") }
|
6
7
|
let(:mfa) {
|
7
8
|
instance_double(
|
8
9
|
::HTTP::Message,
|
@@ -252,6 +253,16 @@ describe ::Finicity::Client do
|
|
252
253
|
end
|
253
254
|
end
|
254
255
|
|
256
|
+
context "when the response is 404" do
|
257
|
+
it "returns an empty array" do
|
258
|
+
allow_any_instance_of(::Finicity::V1::Request::GetAccounts).to(
|
259
|
+
receive(:get_accounts).and_return(not_found)
|
260
|
+
)
|
261
|
+
response = subject.get_accounts(1, 2)
|
262
|
+
response.should eq([])
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
255
266
|
context "when the response is an error" do
|
256
267
|
it "fails" do
|
257
268
|
allow_any_instance_of(::Finicity::V1::Request::GetAccounts).to(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finicity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moneydesktop
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|