41 lines
1.1 KiB
Ruby
41 lines
1.1 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("../test_app/config/environment", __FILE__)
|
|
require 'rspec/rails'
|
|
|
|
#include spree's factories
|
|
require 'spree_core/testing_support/factories'
|
|
|
|
# include local factories
|
|
Dir["#{File.dirname(__FILE__)}/factories/**/*.rb"].each do |f|
|
|
fp = File.expand_path(f)
|
|
require fp
|
|
end
|
|
|
|
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
|
|
end
|
|
|
|
Zone.class_eval do
|
|
def self.global
|
|
find_by_name("GlobalZone") || Factory(:global_zone)
|
|
end
|
|
end
|
|
|
|
@configuration ||= AppConfiguration.find_or_create_by_name("Default configuration")
|