diff options
10 files changed, 7 insertions, 8 deletions
@@ -83,7 +83,7 @@ When testing your applications integration with this extension you may use it's Simply add this require statement to your spec_helper: ```ruby -require 'solidus_subscriptions/factories' +require 'solidus_subscriptions/testing_support/factories' ``` Copyright (c) 2016 Stembolt, released under the New BSD License diff --git a/lib/solidus_subscriptions/factories.rb b/lib/solidus_subscriptions/factories.rb deleted file mode 100644 index dc19324..0000000 --- a/lib/solidus_subscriptions/factories.rb +++ /dev/null @@ -1,6 +0,0 @@ -FactoryGirl.define do - # Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them. - # - # Example adding this to your spec_helper will load these Factories for use: - # require 'solidus_subscriptions/factories' -end diff --git a/lib/solidus_subscriptions/testing_support/factories.rb b/lib/solidus_subscriptions/testing_support/factories.rb new file mode 100644 index 0000000..6cafa63 --- /dev/null +++ b/lib/solidus_subscriptions/testing_support/factories.rb @@ -0,0 +1,5 @@ +require 'factory_girl' +require 'spree/testing_support/factories' + +factory_path = "#{File.dirname(__FILE__)}/factories/**/*_factory.rb" +Dir[factory_path].each { |f| require File.expand_path(f) } diff --git a/spec/factories/installment_detail_factory.rb b/lib/solidus_subscriptions/testing_support/factories/installment_detail_factory.rb index e32df4b..e32df4b 100644 --- a/spec/factories/installment_detail_factory.rb +++ b/lib/solidus_subscriptions/testing_support/factories/installment_detail_factory.rb diff --git a/spec/factories/installment_factory.rb b/lib/solidus_subscriptions/testing_support/factories/installment_factory.rb index 59d9d5e..59d9d5e 100644 --- a/spec/factories/installment_factory.rb +++ b/lib/solidus_subscriptions/testing_support/factories/installment_factory.rb diff --git a/spec/factories/line_item_factory.rb b/lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb index af93720..af93720 100644 --- a/spec/factories/line_item_factory.rb +++ b/lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb diff --git a/spec/factories/spree/line_item_factory.rb b/lib/solidus_subscriptions/testing_support/factories/spree/line_item_factory.rb index afa6588..afa6588 100644 --- a/spec/factories/spree/line_item_factory.rb +++ b/lib/solidus_subscriptions/testing_support/factories/spree/line_item_factory.rb diff --git a/spec/factories/spree/order_factory.rb b/lib/solidus_subscriptions/testing_support/factories/spree/order_factory.rb index a2ce307..a2ce307 100644 --- a/spec/factories/spree/order_factory.rb +++ b/lib/solidus_subscriptions/testing_support/factories/spree/order_factory.rb diff --git a/spec/factories/subscription_factory.rb b/lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb index 420baed..420baed 100644 --- a/spec/factories/subscription_factory.rb +++ b/lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 47a4c52..67404c3 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -34,7 +34,7 @@ require 'spree/testing_support/factories' require 'spree/testing_support/url_helpers' # Requires factories defined in lib/solidus_subscriptions/factories.rb -Dir[File.join(File.dirname(__FILE__), 'factories/**/*_factory.rb')].each { |f| require f } +require 'solidus_subscriptions/testing_support/factories' require 'spec_helper' require 'shoulda-matchers' |