Sha256: e2371db04577b5423adafc4993d0e0dd686d4601e1b9c04d7712c1e431a5c8d4

Contents?: true

Size: 1.32 KB

Versions: 7

Compression:

Stored size: 1.32 KB

Contents

ENV['RAILS_ENV'] ||= 'test'

require 'factory_girl'
require 'database_cleaner'
require 'engine_cart'
require 'coveralls'
Coveralls.wear!('rails')
EngineCart.load_application!

require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist

Capybara.register_driver :poltergeist do |app|
  options = {}

  options[:timeout] = 120 if RUBY_PLATFORM == 'java'

  Capybara::Poltergeist::Driver.new(app, options)
end

Capybara.default_wait_time = 15

if ENV['COVERAGE'] || ENV['CI']
  require 'simplecov'
  SimpleCov.formatter = Coveralls::SimpleCov::Formatter
  SimpleCov.start do
    add_filter '/spec/'
  end
end

require 'geoblacklight'

Dir['./spec/support/**/*.rb'].sort.each { |f| require f }

FactoryGirl.definition_file_paths = [File.expand_path('../factories', __FILE__)]
FactoryGirl.find_definitions

RSpec.configure do |config|
  config.use_transactional_fixtures = false

  config.before :each do
    DatabaseCleaner.strategy = if Capybara.current_driver == :rack_test
                                 :transaction
                               else
                                 :truncation
                               end
    DatabaseCleaner.start
  end

  config.after do
    DatabaseCleaner.clean
  end

  config.include Devise::Test::ControllerHelpers, type: :controller
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
geoblacklight-1.0.3 spec/spec_helper.rb
geoblacklight-1.0.2 spec/spec_helper.rb
geoblacklight-1.0.1 spec/spec_helper.rb
geoblacklight-1.0.0 spec/spec_helper.rb
geoblacklight-1.0.0.pre3 spec/spec_helper.rb
geoblacklight-1.0.0.pre2 spec/spec_helper.rb
geoblacklight-1.0.0.pre1 spec/spec_helper.rb