Sha256: dbab10c2042588e28a4478ac8d9fed48b527f979f86a5d7a0ad3ed0c2b518cad
Contents?: true
Size: 980 Bytes
Versions: 18
Compression:
Stored size: 980 Bytes
Contents
require "rails_helper" describe ::Dorsale::BillingMachine::QuotationMultipleVatPdf, pdfs: true do before :each do ::Dorsale::BillingMachine.vat_mode = :multiple end let(:quotation) { q = create(:billing_machine_quotation) create(:billing_machine_quotation_line, :quotation => q, :vat_rate => 19.6, ) q } let(:pdf) { quotation.pdf } let(:content) { tempfile = Tempfile.new("pdf") tempfile.binmode tempfile.write(pdf.render) tempfile.flush Yomu.new(tempfile.path).text } it "should not display global vat rate" do expect(content).to_not include "TVA 19,60 %" expect(content).to include "MONTANT TVA" expect(content).to include "TVA %" end it "should work with empty quotation" do id_card = Dorsale::BillingMachine::IdCard.new quotation = ::Dorsale::BillingMachine::Quotation.new(id_card: id_card) expect { quotation.pdf.render }.to_not raise_error end end
Version data entries
18 entries across 18 versions & 1 rubygems