Sha256: ca73ac75cfcb7b8461f88cb8a956ede91eec4ae02340581027538a2bb515b3c4

Contents?: true

Size: 1.58 KB

Versions: 6

Compression:

Stored size: 1.58 KB

Contents

# Requires factories and other useful helpers defined in spree_core.
require 'spree/testing_support/authorization_helpers'
require 'spree/testing_support/capybara_ext'
require 'spree/testing_support/factories'
require 'spree/testing_support/preferences'
require 'spree/testing_support/controller_requests'
require 'spree/testing_support/flash'
require 'spree/testing_support/url_helpers'
require 'spree/testing_support/order_walkthrough'
require 'spree/testing_support/auth_helpers'
require 'spree/testing_support/checkout_helpers'
require 'spree/testing_support/caching'

# API v2 helpers
require 'spree/api/testing_support/v2/base'
require 'spree/api/testing_support/v2/current_order'

RSpec.configure do |config|
  # Infer an example group's spec type from the file location.
  config.infer_spec_type_from_file_location!

  # == URL Helpers
  #
  # Allows access to Spree's routes in specs:
  #
  # visit spree.admin_path
  # current_path.should eql(spree.products_path)
  config.include Spree::TestingSupport::UrlHelpers

  # == Requests support
  #
  # Adds convenient methods to request Spree's controllers
  # spree_get :index
  config.include Spree::TestingSupport::ControllerRequests, type: :controller

  config.include Spree::TestingSupport::Preferences
  config.include Spree::TestingSupport::Flash

  config.include Spree::TestingSupport::AuthHelpers, type: :feature
  config.include Spree::TestingSupport::CheckoutHelpers, type: :feature

  config.before :each do
    Rails.cache.clear
    reset_spree_preferences do |config|
      # config.my_custom_preference = 10
    end
    create(:store)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spree_dev_tools-0.1.4 lib/spree_dev_tools/rspec/support/spree.rb
spree_dev_tools-0.1.3 lib/spree_dev_tools/rspec/support/spree.rb
spree_dev_tools-0.1.2 lib/spree_dev_tools/rspec/support/spree.rb
spree_dev_tools-0.1.1 lib/spree_dev_tools/rspec/support/spree.rb
spree_dev_tools-0.1.0 lib/spree_dev_tools/rspec/support/spree.rb
spree_dev_tools-0.0.9 lib/spree_dev_tools/rspec/support/spree.rb