Sha256: a9e3a58402cfd68a7fea233b3c71ea04864eda19c37300f451a13ff638192874

Contents?: true

Size: 1.33 KB

Versions: 30

Compression:

Stored size: 1.33 KB

Contents

# Read about factories at https://github.com/thoughtbot/factory_girl

FactoryGirl.define do
  factory :mno_enterprise_invoice, :class => 'Invoice' do
    
    
    factory :invoice, class: MnoEnterprise::Invoice do
      sequence(:id)
      sequence(:slug) { |n| "201504-NU#{n}" }
      organization_id 265
      
      started_at 28.days.ago
      ended_at 3.days.ago
      created_at 3.days.ago 
      updated_at 1.hour.ago 
      paid_at nil
      
      price Money.new(7980,'AUD')
      billing_address "205 Bla Street, Sydney"
      total_due Money.new(7980,'AUD')
      total_payable Money.new(7980,'AUD')
      total_due_remaining Money.new(7980,'AUD')
      credit_paid Money.new(0,'AUD')
      
      tax_payable Money.new(590,'AUD')
      tax_due_remaining Money.new(590,'AUD')
      
      previous_total_due Money.new(0,'AUD')
      previous_total_paid Money.new(0,'AUD')
      
      tax_pips_applied 5000
      
      billing_summary [
        {
          "name"=>"vTiger 5.4", 
          "usage"=>"499h", 
          "label"=>"vTiger", 
          "price_tag"=>"$19.95", 
          "lines"=>[
            {"label"=>"Application plan", "price_tag"=>"$19.95"}
          ]
        }
      ]
      
      # Properly build the resource with Her
      initialize_with { new(attributes).tap { |e| e.clear_attribute_changes! } }
    end
    
    
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mno-enterprise-core-3.4.0 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.3.3 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.3.2 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.2.1 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.3.1 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.3.0 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.2.0 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.1.4 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.0.7 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-2.0.9 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.1.3 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.0.6 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-2.0.8 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.1.2 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.0.5 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-2.0.7 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-2.0.6 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-2.0.5 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.1.1 lib/mno_enterprise/testing_support/factories/invoices.rb
mno-enterprise-core-3.0.4 lib/mno_enterprise/testing_support/factories/invoices.rb