Sha256: a3bb714e9c51337d9ff8827459975c352530c1c5e359ff01032f91367645d86f

Contents?: true

Size: 1.01 KB

Versions: 23

Compression:

Stored size: 1.01 KB

Contents

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

require File.expand_path("../dummy/config/environment.rb",  __FILE__)
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)

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

Capybara.javascript_driver = :poltergeist

Capybara.register_driver :poltergeist do |app|
  Capybara::Poltergeist::Driver.new(app, {js_errors: true})
end

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }


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

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

  config.before(:each) do
    DatabaseCleaner.strategy = :transaction
  end

  config.before(:each, :js => true) do
    DatabaseCleaner.strategy = :truncation
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
  end


end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
tabulatr2-0.9.14 spec/spec_helper.rb
tabulatr2-0.9.13 spec/spec_helper.rb
tabulatr2-0.9.12 spec/spec_helper.rb
tabulatr2-0.9.11 spec/spec_helper.rb
tabulatr2-0.9.10 spec/spec_helper.rb
tabulatr2-0.9.7 spec/spec_helper.rb
tabulatr2-0.9.6 spec/spec_helper.rb
tabulatr2-0.9.4 spec/spec_helper.rb
tabulatr2-0.9.3 spec/spec_helper.rb
tabulatr2-0.9.2 spec/spec_helper.rb
tabulatr2-0.9.1 spec/spec_helper.rb
tabulatr2-0.9.0 spec/spec_helper.rb
tabulatr2-0.8.9 spec/spec_helper.rb
tabulatr2-0.8.8 spec/spec_helper.rb
tabulatr2-0.8.7 spec/spec_helper.rb
tabulatr2-0.8.6 spec/spec_helper.rb
tabulatr2-0.8.5 spec/spec_helper.rb
tabulatr2-0.8.4 spec/spec_helper.rb
tabulatr2-0.8.3 spec/spec_helper.rb
tabulatr2-0.8.2 spec/spec_helper.rb