Sha256: 3a3bd4252002475850adcf172bc5b81824358e6551191ddd01b1a65decbce152
Contents?: true
Size: 974 Bytes
Versions: 7
Compression:
Stored size: 974 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(:generate!) { Dorsale::BillingMachine::PdfFileGenerator.(quotation) quotation.reload } let(:content) { generate! PDF::Reader.new(quotation.pdf_file.path).pages.map(&:text).join("\n") } 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 quotation = ::Dorsale::BillingMachine::Quotation.new expect { described_class.new(quotation).tap(&:build).render_with_attachments }.to_not raise_error end end
Version data entries
7 entries across 7 versions & 1 rubygems