test/pagarme/resources/recipient_test.rb in pagarme-2.1.2 vs test/pagarme/resources/recipient_test.rb in pagarme-2.1.3
- old
+ new
@@ -1,9 +1,9 @@
require_relative '../../test_helper'
module PagarMe
- class RecipientTest < Test::Unit::TestCase
+ class RecipientTest < PagarMeTestCase
should 'be able to create a recipient with bank_account data' do
recipient = PagarMe::Recipient.create recipient_with_nested_bank_account_params
assert_not_nil recipient.date_created
end
@@ -16,18 +16,15 @@
end
should 'not be able to create a recipient without bank_account data' do
recipient = PagarMe::Recipient.new recipient_params
exception = assert_raises(PagarMe::ValidationError){ recipient.create }
-
- [:bank_code, :agencia, :conta_dv, :conta, :document_number, :legal_name].each do |missing_attr|
- assert_has_error_param exception, "bank_account[#{missing_attr}]"
- end
+ assert_has_error_param exception, 'bank_account_id'
assert_nil recipient.date_created
end
should 'be able to search' do
- recipient = PagarMe::Recipient.create recipient_with_nested_bank_account_params
+ PagarMe::Recipient.create recipient_with_nested_bank_account_params
bank_account_doc_number = bank_account_params[:document_number]
recipients = PagarMe::Recipient.find_by 'bank_account[document_number]' => bank_account_doc_number
assert recipients.size > 0