Sha256: 91341ec39ca98b7a59f98085e69de56368e43642fcaa97f686aa1c5cd96962d1

Contents?: true

Size: 919 Bytes

Versions: 28

Compression:

Stored size: 919 Bytes

Contents

require "rails_helper"

describe ::Dorsale::BillingMachine::InvoiceMultipleVatPdf, pdfs: true do
  before :each do
    ::Dorsale::BillingMachine.vat_mode = :multiple
  end

  let(:invoice) {
    i = create(:billing_machine_invoice)

    create(:billing_machine_invoice_line,
      :invoice  => i,
      :vat_rate => 19.6,
    )

    i
  }

  let(:generate!) {
    Dorsale::BillingMachine::PdfFileGenerator.(invoice)
    invoice.reload
  }

  let(:content) {
    generate!
    Yomu.new(invoice.pdf_file.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 invoice" do
    invoice = ::Dorsale::BillingMachine::Invoice.new

    expect {
      described_class.new(invoice).tap(&:build).render_with_attachments
    }.to_not raise_error
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
dorsale-3.15.0 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.11 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.10 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.9 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.8 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.7 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.6 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.5 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.3 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.2 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.1 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.14.0 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.13.0 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.12.0 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.11.0 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.10.3 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.10.2 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.10.1 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.10.0 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb
dorsale-3.9.8 spec/pdfs/dorsale/billing_machine/invoice_multiple_vat_pdf_spec.rb