plaid_rails 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,23 +17,22 @@ module PlaidRails
17
17
 
18
18
  it "delete connect with error" do
19
19
  account = FactoryGirl.create(:account)
20
- expect(Plaid::Connection).to receive(:delete).with('connect',
21
- { access_token: 'test_wells'}).and_raise("boom")
20
+ expect(Plaid::User).to receive(:load).with(:connect, "test_wells").and_raise("boom")
22
21
  expect(Rails.logger).to receive(:error).exactly(2).times
23
22
  account.send(:delete_connect)
24
23
  end
25
24
 
26
25
  it "delete_connect" do
27
26
  account = FactoryGirl.create(:account)
28
- expect(Plaid::Connection).to receive(:delete).with('connect',
29
- { access_token: 'test_wells'})
27
+ user = double
28
+ expect(Plaid::User).to receive(:load).with(:connect, "test_wells").and_return(user)
29
+ expect(user).to receive(:delete)
30
30
  account.send(:delete_connect)
31
31
  end
32
32
 
33
33
  it "does not delete_connect" do
34
34
  FactoryGirl.create(:account)
35
- expect(Plaid::Connection).to_not receive(:delete).with('connect',
36
- { access_token: 'test_wells'})
35
+ expect(Plaid::User).to_not receive(:load).with(:connect, "test_wells").and_raise("boom")
37
36
  account.send(:delete_connect)
38
37
  end
39
38
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  module PlaidRails
3
3
  describe CreateAccountService do
4
4
 
5
- let(:user){Plaid.set_user('test_wells', ['auth'])}
5
+ let(:user){Plaid::User.create(:connect, 'wells', 'plaid_test', 'plaid_good')}
6
6
 
7
7
  let(:account_params){{
8
8
  "account_ids"=> user.accounts.map{|a| a.id},
data/spec/spec_helper.rb CHANGED
@@ -9,9 +9,9 @@ require 'webmock/rspec'
9
9
 
10
10
  WebMock.allow_net_connect!
11
11
  Plaid.config do |p|
12
- p.customer_id = 'test_id'
12
+ p.client_id = 'test_id'
13
13
  p.secret = 'test_secret'
14
- p.environment_location = 'https://tartan.plaid.com/'
14
+ p.env = :tartan
15
15
  end
16
16
  Rails.backtrace_cleaner.remove_silencers!
17
17
  # Load support files
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plaid_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Curt Wilhelm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-11 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: plaid
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 2.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 2.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sqlite3
57
57
  requirement: !ruby/object:Gem::Requirement