spec/plaid_spec.rb in plaid-1.2.1 vs spec/plaid_spec.rb in plaid-1.2.2
- old
+ new
@@ -194,51 +194,51 @@
Plaid.config do |p|
p.customer_id = 'test_id'
p.secret = 'test_secret'
p.environment_location = 'https://tartan.plaid.com/'
end
- user = Plaid.add_user('connect','plaid_selections', 'plaid_locked','wells',{pending: true})
+ user = Plaid.add_user('connect','plaid_selections', 'plaid_good','wells',{pending: true})
it { expect(user.accounts.empty?).to be_falsey }
end
context 'sets the login only option to true' do
Plaid.config do |p|
p.customer_id = 'test_id'
p.secret = 'test_secret'
p.environment_location = 'https://tartan.plaid.com/'
end
- user = Plaid.add_user('connect','plaid_selections', 'plaid_locked','wells',{login_only:true})
+ user = Plaid.add_user('connect','plaid_selections', 'plaid_good','wells',{login_only:true})
it { expect(user.accounts.empty?).to be_falsey }
end
context 'requests a list of options for code based MFA' do
Plaid.config do |p|
p.customer_id = 'test_id'
p.secret = 'test_secret'
p.environment_location = 'https://tartan.plaid.com/'
end
- user = Plaid.add_user('connect','plaid_selections', 'plaid_locked','citi',{list: true})
- it { expect(user.accounts.empty?).to be_falsey }
+ user = Plaid.add_user('connect','plaid_selections', 'plaid_good','citi',{list: true})
+ it { expect(user.pending_mfa_questions.nil?).to be_falsey }
end
context 'sets a start date for transactions' do
Plaid.config do |p|
p.customer_id = 'test_id'
p.secret = 'test_secret'
p.environment_location = 'https://tartan.plaid.com/'
end
- user = Plaid.add_user('connect','plaid_selections', 'plaid_locked','wells',{login_only:true, start_date:'10 days ago'})
+ user = Plaid.add_user('connect','plaid_selections', 'plaid_good','wells',{login_only:true, start_date:'10 days ago'})
it { expect(user.accounts.empty?).to be_falsey }
end
context 'sets an end date for transactions' do
Plaid.config do |p|
p.customer_id = 'test_id'
p.secret = 'test_secret'
p.environment_location = 'https://tartan.plaid.com/'
end
- user = Plaid.add_user('connect','plaid_selections', 'plaid_locked','wells',{login_only:true, end_date: '10 days ago'})
+ user = Plaid.add_user('connect','plaid_selections', 'plaid_good','wells',{login_only:true, end_date: '10 days ago'})
it { expect(user.accounts.empty?).to be_falsey }
end
end
# Institution specs
@@ -420,10 +420,31 @@
context 'does not have access to info' do
it{ expect(auth_user.permissions.include? 'info' ).to be false }
end
end
+ describe '#get_balance' do
+ Plaid.config do |p|
+ p.customer_id = 'test_id'
+ p.secret = 'test_secret'
+ p.environment_location = 'https://tartan.plaid.com/'
+ end
+
+ user = Plaid.add_user('info','plaid_test','plaid_good','wells')
+ user.update_balance
+ context 'updates user accounts' do
+ it { expect(user.accounts.empty?).to be_falsey }
+ end
+
+ context 'should not double up accounts or transactions' do
+ dup = user.accounts.select{|element| user.accounts.count(element) > 1}
+ dup = dup.length + user.transactions.select{|element| user.transactions.count(element) > 1}.length
+ it{ expect(dup).to eq(0) }
+ end
+
+ end
+
=begin
describe '#update_info' do
info_user = Plaid.add_user('info','plaid_test','plaid_good','wells')
context 'updates information correctly' do
@@ -436,9 +457,10 @@
Plaid.config do |p|
p.customer_id = 'test_id'
p.secret = 'test_secret'
p.environment_location = 'https://tartan.plaid.com/'
end
+
info_user = Plaid.add_user('info','plaid_test','plaid_good','wells')
info_user.delete_user
context 'updates information correctly' do
it { expect { info_user.get_info }.to raise_error }
\ No newline at end of file