Sha256: b40b1aace6ea00e05db77e34ce1ca6c6423aaf944093d4f62aeb0aed670089ec

Contents?: true

Size: 1.54 KB

Versions: 3

Compression:

Stored size: 1.54 KB

Contents

require 'json'
require 'pdf/inspector'
require 'rack/test'

lib = File.expand_path('../../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'invoice_printer'
require 'test_ext'
require 'minitest/autorun'

# Test helpers
module InvoicePrinterHelpers
  def default_document_params
    {
      number: '198900000001',
      provider_name: 'Business s.r.o.',
      provider_tax_id: '56565656',
      provider_tax_id2: '465454',
      provider_street: 'Rolnicka',
      provider_street_number: '1',
      provider_postcode: '747 05',
      provider_city: 'Opava',
      provider_city_part: 'Katerinky',
      provider_extra_address_line: 'Czech Republic',
      purchaser_name: 'Adam',
      purchaser_tax_id: nil,
      purchaser_tax_id2: nil,
      purchaser_street: 'Ostravska',
      purchaser_street_number: '1',
      purchaser_postcode: '747 70',
      purchaser_city: 'Opava',
      purchaser_city_part: '',
      purchaser_extra_address_line: '',
      issue_date: '19/03/3939',
      due_date: '19/03/3939',
      subtotal: '175',
      tax: '5',
      tax2: '10',
      tax3: '20',
      total: '$ 200',
      bank_account_number: '156546546465',
      account_iban: 'IBAN464545645',
      account_swift: 'SWIFT5456',
      items: [
        InvoicePrinter::Document::Item.new(
          default_document_item_params
        )
      ]
    }
  end

  def default_document_item_params
    {
      name: 'Web consultation',
      quantity: '2',
      unit: 'hours',
      price: '$ 25',
      tax: '$ 1',
      amount: '$ 100'
    }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
invoice_printer-1.3.0 test/test_helper.rb
invoice_printer-1.2.0 test/test_helper.rb
invoice_printer-1.2.0.alpha1 test/test_helper.rb