Sha256: 7b301232247fe3ec8cd1fd6987aee294be4ddcb93cada638624815fe88bd1413

Contents?: true

Size: 1.48 KB

Versions: 16

Compression:

Stored size: 1.48 KB

Contents

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

  require File.expand_path("../dummy/config/environment", __FILE__)

  require 'rspec/rails'
  require 'capybara/rspec'

  Rails.backtrace_cleaner.remove_silencers!

  RSpec.configure do |config|
    config.mock_with :rspec
    config.treat_symbols_as_metadata_keys_with_true_values = true
    config.filter_run :focus => true
    config.run_all_when_everything_filtered = true
  end

  # set javascript driver for capybara
  Capybara.javascript_driver = :selenium
end

def each_run
  Rails.cache.clear
  ActiveSupport::Dependencies.clear
  FactoryGirl.reload

  # Requires supporting files with custom matchers and macros, etc,
  # in ./support/ and its subdirectories including factories.
  ([Rails.root.to_s] | ::Refinery::Plugins.registered.pathnames).map{|p|
    Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
  }.flatten.sort.each do |support_file|
    require support_file
  end
end

# If spork is available in the Gemfile it'll be used but we don't force it.
unless (begin; require 'spork'; rescue LoadError; nil end).nil?
  Spork.prefork do
    # Loading more in this block will cause your tests to run faster. However,
    # if you change any configuration or code from libraries loaded here, you'll
    # need to restart spork for it take effect.
    setup_environment
  end

  Spork.each_run do
    # This code will be run each time you run your specs.
    each_run
  end
else
  setup_environment
  each_run
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
refinerycms-stores-0.1.0 spec/spec_helper.rb
refinerycms-stores-0.0.16 spec/spec_helper.rb
refinerycms-stores-0.0.14 spec/spec_helper.rb
refinerycms-stores-0.0.13 spec/spec_helper.rb
refinerycms-stores-0.0.12 spec/spec_helper.rb
refinerycms-stores-0.0.11 spec/spec_helper.rb
refinerycms-stores-0.0.10 spec/spec_helper.rb
refinerycms-stores-0.0.9 spec/spec_helper.rb
refinerycms-stores-0.0.8 spec/spec_helper.rb
refinerycms-stores-0.0.7 spec/spec_helper.rb
refinerycms-stores-0.0.6 spec/spec_helper.rb
refinerycms-stores-0.0.5 spec/spec_helper.rb
refinerycms-stores-0.0.4 spec/spec_helper.rb
refinerycms-stores-0.0.3 spec/spec_helper.rb
refinerycms-stores-0.0.2 spec/spec_helper.rb
refinerycms-stores-0.0.1 spec/spec_helper.rb