Sha256: 5549b91bad405f9398e1e101f9d590437098cd36c11952e635e404395dd016f1

Contents?: true

Size: 769 Bytes

Versions: 9

Compression:

Stored size: 769 Bytes

Contents

require 'test_helper'

class FactoriesTest < ActiveSupport::TestCase
  fixtures :payment_methods, :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

9 entries across 9 versions & 1 rubygems

Version Path
spree-0.11.4 test/unit/factories_test.rb
spree-0.11.3 test/unit/factories_test.rb
spree-0.11.2 test/unit/factories_test.rb
spree-0.11.1 test/unit/factories_test.rb
spree-0.11.0 test/unit/factories_test.rb
spree-0.10.2 test/unit/factories_test.rb
spree-0.10.1 test/unit/factories_test.rb
spree-0.10.0 test/unit/factories_test.rb
spree-0.10.0.beta test/unit/factories_test.rb