spec/lib/mangopay/bank_account_spec.rb in mangopay-3.0.1 vs spec/lib/mangopay/bank_account_spec.rb in mangopay-3.0.2

- old
+ new

@@ -1,26 +1,25 @@ -require_relative '../../spec_helper' - -describe MangoPay::BankAccount do - include_context 'users' - include_context 'bank_details' - - describe 'CREATE' do - it 'creates a new bank detail' do - expect(new_iban_bank_detail['Id']).not_to be_nil - end - end - - describe 'FETCH' do - - it 'fetches all the bank details' do - bank_details = MangoPay::BankAccount.fetch(new_iban_bank_detail['UserId']) - expect(bank_details).to be_kind_of(Array) - expect(bank_details[0]['Id']).to eq(new_iban_bank_detail['Id']) - end - - it 'fetches one bank detail' do - bank_detail = MangoPay::BankAccount.fetch(new_iban_bank_detail['UserId'], new_iban_bank_detail['Id']) - expect(bank_detail['Id']).to eq(new_iban_bank_detail['Id']) - end - end -end +require_relative '../../spec_helper' + +describe MangoPay::BankAccount do + include_context 'bank_accounts' + + describe 'CREATE' do + it 'creates a new bank detail' do + expect(new_bank_account['Id']).not_to be_nil + end + end + + describe 'FETCH' do + + it 'fetches all the bank details' do + list = MangoPay::BankAccount.fetch(new_bank_account['UserId']) + expect(list).to be_kind_of(Array) + expect(list[0]['Id']).to eq(new_bank_account['Id']) + end + + it 'fetches single bank detail' do + single = MangoPay::BankAccount.fetch(new_bank_account['UserId'], new_bank_account['Id']) + expect(single['Id']).to eq(new_bank_account['Id']) + end + end +end