Sha256: 01888c1fd04b586f16fd1e4b1252d04705c3263cfef9d87c645558e6d7b15d43

Contents?: true

Size: 1.4 KB

Versions: 1

Compression:

Stored size: 1.4 KB

Contents

# Configure Rails Environment
ENV['RAILS_ENV'] ||= 'test'

require File.expand_path('../dummy/config/environment.rb',  __FILE__)
require 'rspec/rails'
require 'capybara/rails'
require 'factory_girl_rails'
require 'database_cleaner'
require 'ffaker'

StateMachines::Machine.ignore_method_conflicts = true

require 'spree/testing_support/url_helpers'
require 'spree/testing_support/controller_requests'
require 'spree/testing_support/factories'
require 'spree_liqpay/factories'

Rails.backtrace_cleaner.remove_silencers!

# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

FactoryGirl::SyntaxRunner.send :include, Spree::TestingSupport::UrlHelpers

RSpec.configure do |config|
  config.include FactoryGirl::Syntax::Methods
  config.include Spree::TestingSupport::UrlHelpers

  config.include Faker::Name
  config.include Faker::Internet
  config.include Faker::AddressUS
  config.include Faker::PhoneNumber

  config.mock_with :rspec
  config.color = true
  config.use_transactional_fixtures = false

  Capybara.ignore_hidden_elements = false

  config.before :suite do
    DatabaseCleaner.clean_with :truncation
  end

  config.before :each do |example|
    DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction
    DatabaseCleaner.start
  end

  config.after :each do |example|
    Capybara.reset_sessions! if example.metadata[:js]
    DatabaseCleaner.clean
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_liqpay-0.1.0 spec/spec_helper.rb