test/spec/requesttimeout_spec.rb in openpay-1.0.5 vs test/spec/requesttimeout_spec.rb in openpay-1.0.6

- old
+ new

@@ -1,38 +1,20 @@ require_relative '../spec_helper' -describe Bankaccounts do +describe 'Request timeout exception' do - #bankaccounts for merchant cannot be created using the api - #the merchant bank account should be created using the Openpay dashboard before(:all) do @merchant_id='mywvupjjs9xdnryxtplq' @private_key='sk_92b25d3baec149e6b428d81abfe37006' - @openpay=OpenpayApi.new(@merchant_id, @private_key, false, 30) - @bank_accounts=@openpay.create(:bankaccounts) - @customers=@openpay.create(:customers) + @openpay=OpenpayApi.new(@merchant_id, @private_key, false, 0) + @charges=@openpay.create(:charges) end - describe '.get' do - - it 'get a given bank account for a given customer' do - - customer_hash= FactoryGirl.build(:customer) - customer=@customers.create(customer_hash) - - account_hash=FactoryGirl.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']) - @customers.delete(customer['id']) - - end - + it 'raise a OpenpayException when the operation timeouts' do + expect{@charges.all}.to raise_error(OpenpayException) end end