From fb318e37cb96bf1092a9b82018a488808f518f82 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Fri, 10 Apr 2015 13:40:37 +0300 Subject: [PATCH] Add registrar invoice spec --- spec/models/registrar_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/models/registrar_spec.rb b/spec/models/registrar_spec.rb index 4c92e5f66..e4f39026b 100644 --- a/spec/models/registrar_spec.rb +++ b/spec/models/registrar_spec.rb @@ -84,5 +84,14 @@ describe Registrar do @new_registrar.errors.full_messages.should == [] @new_registrar.code.should == 'uniq1' end + + it 'should be able to issue a prepayment invoice' do + Fabricate(:registrar, name: 'EIS', reg_no: '90010019') + @registrar.issue_prepayment_invoice(200, 'add some money') + @registrar.invoices.count.should == 1 + i = @registrar.invoices.first + i.total.should == BigDecimal.new('240.0') + i.description.should == 'add some money' + end end end