spree_paypal_express/spec/spec_helper.rb

57 lines
1.7 KiB
Ruby

# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../dummy/config/environment", __FILE__)
require 'rspec/rails'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[File.join(File.dirname(__FILE__), "support/**/*.rb")].each {|f| require f }
#include spree's factories
require 'spree/core/testing_support/factories'
require 'spree/core/testing_support/fixtures'
# include local factories
Dir["#{File.dirname(__FILE__)}/factories/**/*.rb"].each do |f|
fp = File.expand_path(f)
require fp
end
require 'ffaker'
RSpec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec
config.fixture_path = "#{::Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, comment the following line or assign false
# instead of true.
config.use_transactional_fixtures = true
config.include Spree::UrlHelpers
end
Spree::Zone.class_eval do
def self.global
find_by_name("GlobalZone") || Factory(:global_zone)
end
end
# class ActionController::TestCase
# module Behavior
# def process_with_default_host(action, parameters = nil, session = nil, flash = nil, http_method = 'GET')
# parameters = { :host => 'example.com' }.merge( parameters || {} )
# process_without_default_host(action, parameters, session, flash, http_method)
# end
# alias_method_chain :process, :default_host
# end
# end