Sha256: 8ae3a03301f165f0281cbdad62f37859efe0d240065eaa8daff3b6c8dd7821e6
Contents?: true
Size: 768 Bytes
Versions: 61
Compression:
Stored size: 768 Bytes
Contents
require "rails_helper" describe Dorsale::BillingMachine::Quotation::Statistics do let(:statistics) { Dorsale::BillingMachine::Quotation::Statistics.new(Dorsale::BillingMachine::Quotation.all) } it "stats should not include canceled quotations" do q1 = create(:billing_machine_quotation_line, quantity: 1, unit_price: 10) q1.quotation.update!(state: "pending") q2 = create(:billing_machine_quotation_line, quantity: 1, unit_price: 10) q2.quotation.update!(state: "canceled") expect(statistics.total_excluding_taxes).to eq 10 end it "stats should be 0 if no quotations" do expect(statistics.total_excluding_taxes).to eq 0 expect(statistics.vat_amount).to eq 0 expect(statistics.total_including_taxes).to eq 0 end end
Version data entries
61 entries across 61 versions & 1 rubygems