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: 64b9a11eb9733de5c18f224d22ffc52cf2053921
4
- data.tar.gz: 7c92ae39b471529d735eadf2acaab8b0f2b8d17a
3
+ metadata.gz: 7b098f2e47f9c53c1f98d3a78f144b88aa3c1de2
4
+ data.tar.gz: da0f3715ebe1058bc3aca43e8b23826dfc55c4e3
5
5
  SHA512:
6
- metadata.gz: f01c8b5be48f0b3413126a3e4c8003e3d78dcb8c4652080ec3ffceb259f03f91e462f77e4cc99f79052dea9f8b6bae2f8c8bd3c177107691fde0abf3482eeddb
7
- data.tar.gz: 358e584e41e566ca2877473391dc9f0a9874d3d8999ff3a44a5f3498aa9ef681ef72d6d99e6832e235fafc08c6abf27780d7507e5d00db82eac9b50edfe0c07a
6
+ metadata.gz: 3932de91e2a85786bf99a602ac765bfb6e07a816cf66fd2a094f20725442626b95c9378ca3cace828d45efd7e82ee20d9d2637abc0eb1d3d4e9915525d722e44
7
+ data.tar.gz: a648e639ccda88f0d3fab206438b08c468cdf975023343a31a27011a9bfac6f82f4ebd126f064001dee40775b847eab82442fac8b2d79d3ee7e0c8729bd8ebdc
@@ -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
@@ -46,7 +46,8 @@ module Finicity::V1
46
46
  ::URI.join(
47
47
  ::Finicity.config.base_url,
48
48
  'v1/',
49
- 'customers'
49
+ 'customers/',
50
+ 'active'
50
51
  )
51
52
  end
52
53
  end
@@ -1,3 +1,3 @@
1
1
  module Finicity
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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(
@@ -31,7 +31,7 @@ describe ::Finicity::V1::Request::AddCustomer do
31
31
 
32
32
  describe "#url" do
33
33
  it "has a correct url" do
34
- subject.url.to_s.should include('customers')
34
+ subject.url.to_s.should include('customers/active')
35
35
  end
36
36
  end
37
37
  end
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.0
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-08 00:00:00.000000000 Z
11
+ date: 2014-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient