From ed49a1323d697b522137837a2ed86c206b48a9f2 Mon Sep 17 00:00:00 2001 From: rodrigo brancher Date: Tue, 22 Dec 2015 01:36:12 -0200 Subject: [PATCH] Add :identity property to Customer, allowing creation of billets with client document identification --- lib/braspag-rest/customer.rb | 1 + spec/customer_spec.rb | 4 +++- spec/request_spec.rb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/braspag-rest/customer.rb b/lib/braspag-rest/customer.rb index 79807ea..eb71f9c 100644 --- a/lib/braspag-rest/customer.rb +++ b/lib/braspag-rest/customer.rb @@ -1,5 +1,6 @@ module BraspagRest class Customer < Hashie::IUTrash property :name, from: 'Name' + property :identity, from: 'Identity' end end diff --git a/spec/customer_spec.rb b/spec/customer_spec.rb index 76aa25a..18a3488 100644 --- a/spec/customer_spec.rb +++ b/spec/customer_spec.rb @@ -3,7 +3,8 @@ describe BraspagRest::Customer do let(:braspag_response) { { - 'Name' => 'Comprador Teste' + 'Name' => 'Comprador Teste', + 'Identity' => '790.010.515-88' } } @@ -12,6 +13,7 @@ it 'initializes a customer using braspag response format' do expect(customer.name).to eq('Comprador Teste') + expect(customer.identity).to eq('790.010.515-88') end end end diff --git a/spec/request_spec.rb b/spec/request_spec.rb index 19e5e89..f10f7f8 100644 --- a/spec/request_spec.rb +++ b/spec/request_spec.rb @@ -28,7 +28,7 @@ let(:params) { { - 'Customer' => { 'Name' => 'Maria' } + 'Customer' => { 'Name' => 'Maria', 'Identity' => '790.010.515-88' } } }