Sha256: b9c157e1161ba6dfa2f5ec012e1466edf19ccedb068bd3611514526ba16a0bef

Contents?: true

Size: 751 Bytes

Versions: 6

Compression:

Stored size: 751 Bytes

Contents

require 'test_helper'

class FactoriesTest < ActiveSupport::TestCase
  fixtures :countries

  (Factory.factories.keys - [:global_zone]).each do |factory|
    context factory.to_s do
      should "generate valid record" do
        Timeout.timeout(2) do
          assert Factory.build(factory).valid?
        end
      end
    end
  end

  [:adjustment, :charge, :credit].each do |charge_type|
    context "#{charge_type} factory" do
      should "return correct classes" do
        assert_equal(charge_type.to_s.camelize, Factory.build(charge_type).class.name)
      end
    end
  end

  context "TaxCategory" do
    should "create tax rate" do
      assert(Factory(:tax_category).tax_rates.reload.first, "tax rate was not created.")
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
spree-enriquez-0.9.4 test/unit/factories_test.rb
spree-0.9.4 test/unit/factories_test.rb
spree-0.9.3 test/unit/factories_test.rb
spree-0.9.2 test/unit/factories_test.rb
spree-0.9.1 test/unit/factories_test.rb
spree-0.9.0 test/unit/factories_test.rb