test/spec/bankaccounts_spec.rb in openpay-1.0.10 vs test/spec/bankaccounts_spec.rb in openpay-2.0.0b
- old
+ new
@@ -21,38 +21,38 @@
it 'has all required methods' do
%w(all each create get list delete).each do |meth|
expect(@bank_accounts).to respond_to(meth)
end
end
-
+=begin
describe '.create' do
it 'creates a customer bank account' do
- customer_hash= FactoryGirl.build(:customer)
+
+ customer_hash= FactoryBot.build(:customer)
customer=@customers.create(customer_hash)
-
- account_hash=FactoryGirl.build(:bank_account)
+
+ account_hash=FactoryBot.build(:bank_account)
bank=@bank_accounts.create(account_hash, customer['id'])
bank_account=@bank_accounts.get(customer['id'], bank['id'])
- expect(bank_account['alias']).to match 'Cuenta principal'
+ expect(bank_account['alias']).to match "Cuenta principal"
@bank_accounts.delete(customer['id'], bank['id'])
@customers.delete(customer['id'])
end
end
-
describe '.get' do
it 'get a given bank account for a given customer' do
- customer_hash= FactoryGirl.build(:customer)
+ customer_hash= FactoryBot.build(:customer)
customer=@customers.create(customer_hash)
- account_hash=FactoryGirl.build(:bank_account)
+ account_hash=FactoryBot.build(:bank_account)
bank=@bank_accounts.create(account_hash, customer['id'])
bank_account=@bank_accounts.get(customer['id'], bank['id'])
expect(bank_account['alias']).to match 'Cuenta principal'
@bank_accounts.delete(customer['id'], bank['id'])
@@ -64,14 +64,14 @@
describe '.each' do
it 'iterator for all given customer bank accounts' do
- customer_hash= FactoryGirl.build(:customer)
+ customer_hash= FactoryBot.build(:customer)
customer=@customers.create(customer_hash)
- account_hash=FactoryGirl.build(:bank_account)
+ account_hash=FactoryBot.build(:bank_account)
bank=@bank_accounts.create(account_hash, customer['id'])
@bank_accounts.each(customer['id']) do |bank_account|
expect(bank_account['alias']).to match 'Cuenta principal'
end
@@ -85,15 +85,15 @@
describe '.list' do
it 'list the bank accounts using a given filter' do
- customer_hash= FactoryGirl.build(:customer)
+ customer_hash= FactoryBot.build(:customer)
customer=@customers.create(customer_hash)
expect(@bank_accounts.all(customer['id']).size).to be 0
- account_hash=FactoryGirl.build(:bank_account)
+ account_hash=FactoryBot.build(:bank_account)
bank=@bank_accounts.create(account_hash, customer['id'])
expect(@bank_accounts.all(customer['id']).size).to be 1
search_params = OpenpayUtils::SearchParams.new
search_params.limit = 1
@@ -109,15 +109,15 @@
describe '.all' do
it 'all bank accounts for a given customer' do
- customer_hash= FactoryGirl.build(:customer)
+ customer_hash= FactoryBot.build(:customer)
customer=@customers.create(customer_hash)
expect(@bank_accounts.all(customer['id']).size).to be 0
- account_hash=FactoryGirl.build(:bank_account)
+ account_hash=FactoryBot.build(:bank_account)
bank=@bank_accounts.create(account_hash, customer['id'])
expect(@bank_accounts.all(customer['id']).size).to be 1
@bank_accounts.delete(customer['id'], bank['id'])
@customers.delete(customer['id'])
@@ -132,15 +132,15 @@
describe '.delete' do
it 'deletes a given bank account' do
- customer_hash= FactoryGirl.build(:customer)
+ customer_hash= FactoryBot.build(:customer)
customer=@customers.create(customer_hash)
expect(@bank_accounts.all(customer['id']).size).to be 0
- account_hash=FactoryGirl.build(:bank_account)
+ account_hash=FactoryBot.build(:bank_account)
bank=@bank_accounts.create(account_hash, customer['id'])
expect(@bank_accounts.all(customer['id']).size).to be 1
@bank_accounts.delete(customer['id'], bank['id'])
@customers.delete(customer['id'])
@@ -155,14 +155,14 @@
describe '.delete_all' do
it 'deletes all bank accounts' do
- customer_hash= FactoryGirl.build(:customer)
+ customer_hash= FactoryBot.build(:customer)
customer=@customers.create(customer_hash)
- account_hash=FactoryGirl.build(:bank_account)
+ account_hash=FactoryBot.build(:bank_account)
@bank_accounts.create(account_hash, customer['id'])
expect(@bank_accounts.all(customer['id']).size).to be 1
@bank_accounts.delete_all(customer['id'])
@@ -177,6 +177,7 @@
bank_accounts=@openpayprod.create(:bankaccounts)
expect { bank_accounts.delete_all('111111') }.to raise_exception OpenpayException
end
end
+=end
end