diff options
author | Brendan Deere <brendan@stembolt.com> | 2016-09-22 11:19:32 -0700 |
---|---|---|
committer | Brendan Deere <brendan@stembolt.com> | 2016-09-22 11:44:00 -0700 |
commit | da3ca246d6cb962108c28c68311df86403e234f3 (patch) | |
tree | ef81147bac8a9f5c020b6025b7bd9d67a2ec1170 | |
parent | ebc71262df97c3ab4f06bfb37fc2a70f85a1dc49 (diff) |
Move factories to testing support
So that parent applications can use them
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' |