Skip to content

Commit

Permalink
Add :identity property to Customer, allowing creation of billets with…
Browse files Browse the repository at this point in the history
… client document identification
  • Loading branch information
rbrancher committed Dec 22, 2015
1 parent b985cfe commit ed49a13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/braspag-rest/customer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module BraspagRest
class Customer < Hashie::IUTrash
property :name, from: 'Name'
property :identity, from: 'Identity'
end
end
4 changes: 3 additions & 1 deletion spec/customer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
describe BraspagRest::Customer do
let(:braspag_response) {
{
'Name' => 'Comprador Teste'
'Name' => 'Comprador Teste',
'Identity' => '790.010.515-88'
}
}

Expand All @@ -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
2 changes: 1 addition & 1 deletion spec/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

let(:params) {
{
'Customer' => { 'Name' => 'Maria' }
'Customer' => { 'Name' => 'Maria', 'Identity' => '790.010.515-88' }
}
}

Expand Down

0 comments on commit ed49a13

Please sign in to comment.