summaryrefslogtreecommitdiff
path: root/spec/support/helpers/checkout_infrastructure.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/checkout_infrastructure.rb')
-rw-r--r--spec/support/helpers/checkout_infrastructure.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/support/helpers/checkout_infrastructure.rb b/spec/support/helpers/checkout_infrastructure.rb
new file mode 100644
index 0000000..6a18083
--- /dev/null
+++ b/spec/support/helpers/checkout_infrastructure.rb
@@ -0,0 +1,22 @@
+# Extend your spec with this module if you want your spec to be able to move
+# an order through the checkout process
+module CheckoutInfrastructure
+ def self.extended(base)
+ base.before(:all) do
+ payment_method = create :credit_card_payment_method
+ create :country
+ create :shipping_method
+
+ SolidusSubscriptions::Config.default_gateway { payment_method }
+ end
+
+ base.after(:all) do
+ DatabaseCleaner.clean_with(:truncation)
+ SolidusSubscriptions::Config.default_gateway { nil }
+ end
+ end
+end
+
+RSpec.configure do |config|
+ config.extend CheckoutInfrastructure, :checkout
+end