plaid_rails 0.6.0 → 0.7.0

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: c8addb91fb8b76b1d63bdc11afefc10043a3978b
4
- data.tar.gz: 7cd3dc1b60cb373f03ea63d0e7204ed7139e0eb8
3
+ metadata.gz: 771ba4a90c8b9062f54c625fe4a278473141fab9
4
+ data.tar.gz: 2ad9623012e8ff176e3840e54e105fb4cb651542
5
5
  SHA512:
6
- metadata.gz: d235ad574ae428818fac0d4bc5e72b47060904be31684a34ea8418fbc5338360f9875815b4f2dca355b867f18f3cf8b62e2176949f20decf484459837434c310
7
- data.tar.gz: ef19a24c6b75480b3baf64a8b99dd50f916091b5e5f96769da9fb695033ed6b89015ba034b4a5ee76b87feacfc498f221188ff3352f4e2db200db072117c043a
6
+ metadata.gz: 0f3aa32864d39a3543a7f3ac47bc60ae3a895e2789a167314f4c0cd0992daae73716b26d1ea3f8a4f49d98a7004206facda5eec1baa205bd618d7d4f838576b7
7
+ data.tar.gz: 075d3c3c7bca35df5c5fc0016568e41c4d59b189c6c06f4b8f2844c6359480995ff31f46c243f21817998c18df3e3a28fae1193ae6d30751bdfa9a33818147a3
@@ -4,7 +4,7 @@ module PlaidRails
4
4
  class AccountsController < ApplicationController
5
5
 
6
6
  def index
7
- @accounts =PlaidRails::Account.where(owner_id: account_params[:owner_id])
7
+ @plaid_accounts =PlaidRails::Account.where(owner_id: account_params[:owner_id])
8
8
  end
9
9
 
10
10
  # display list of accounts for authenticated user
@@ -12,12 +12,12 @@ module PlaidRails
12
12
  account_params["access_token"]
13
13
  @user = Plaid::User.load(:connect, account_params["access_token"])
14
14
  @user.transactions
15
- @accounts = @user.accounts
15
+ @plaid_accounts = @user.accounts
16
16
  end
17
17
 
18
18
  #create new bank account and return all the accounts for the owner
19
19
  def create
20
- @accounts = PlaidRails::CreateAccountService.call(account_params)
20
+ @plaid_accounts = PlaidRails::CreateAccountService.call(account_params)
21
21
  end
22
22
 
23
23
  def update
@@ -25,8 +25,8 @@ module PlaidRails
25
25
  end
26
26
 
27
27
  def destroy
28
- account = PlaidRails::Account.find(params[:id])
29
- account.destroy
28
+ @plaid_account = PlaidRails::Account.find(params[:id])
29
+ @plaid_account.destroy
30
30
  end
31
31
 
32
32
  private
@@ -20,9 +20,9 @@ module PlaidRails
20
20
  begin
21
21
  exchange_token = Plaid::User.exchange_token(link_params[:public_token])
22
22
 
23
- @accounts =PlaidRails::Account.where(owner_type: link_params[:owner_type],
23
+ @plaid_accounts =PlaidRails::Account.where(owner_type: link_params[:owner_type],
24
24
  owner_id: link_params[:owner_id])
25
- @accounts.each do |account|
25
+ @plaid_accounts.each do |account|
26
26
  account.update(access_token: exchange_token.access_token)
27
27
  end
28
28
  flash[:success]="You have successfully updated your account(s)"
@@ -1,5 +1,5 @@
1
1
  <h3>Accounts</h3>
2
2
 
3
- <% @accounts.each do |account| %>
3
+ <% @plaid_accounts.each do |account| %>
4
4
  <%=account.name%> <br/>
5
5
  <%end%>
@@ -1,3 +1,3 @@
1
1
  module PlaidRails
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -10,7 +10,7 @@ module PlaidRails
10
10
  it "get index" do
11
11
  get :index, account:{owner_id: 1}
12
12
  expect(response).to be_success
13
- expect(assigns(:accounts)).to eq [account]
13
+ expect(assigns(:plaid_accounts)).to eq [account]
14
14
 
15
15
  end
16
16
 
@@ -18,7 +18,7 @@ module PlaidRails
18
18
  get :new, account:{access_token: 'test_wells', name:'Wells Fargo', type: 'wells',
19
19
  owner_id: "1", owner_type: "User"}
20
20
  expect(response).to be_success
21
- expect(assigns(:accounts)).to_not be_nil
21
+ expect(assigns(:plaid_accounts)).to_not be_nil
22
22
  end
23
23
 
24
24
  it "can create" do
@@ -27,13 +27,14 @@ module PlaidRails
27
27
  name:'Wells Fargo', type: 'wells', owner_id: "1", owner_type: "User",
28
28
  token: public_token}
29
29
  expect(response).to be_success
30
- expect(assigns(:accounts).size).to eq 4
31
- expect(assigns(:accounts).first.bank_name).to eq 'Wells Fargo'
30
+ expect(assigns(:plaid_accounts).size).to eq 4
31
+ expect(assigns(:plaid_accounts).first.bank_name).to eq 'Wells Fargo'
32
32
  end
33
33
 
34
34
  it "can destroy" do
35
35
  delete :destroy, id: account.id
36
36
  expect(response).to be_success
37
+ expect(assigns(:plaid_account)).to eq account
37
38
  end
38
39
 
39
40
  # it {
@@ -24,7 +24,7 @@ module PlaidRails
24
24
  xhr :post, :update, public_token: 'test,wells,connected', name:'Wells Fargo', type: 'wells',
25
25
  owner_id: "1", owner_type: "User"
26
26
  expect(response).to be_success
27
- expect(assigns(:accounts)).to_not be_nil
27
+ expect(assigns(:plaid_accounts)).to_not be_nil
28
28
  expect(response).to render_template('plaid_rails/link/update')
29
29
  end
30
30
  it {