Sha256: e1865e6ef028aeca5b6bbb5ecea2c94ce6d149cb152c8d59f7cb1ade94c51bd5

Contents?: true

Size: 640 Bytes

Versions: 2

Compression:

Stored size: 640 Bytes

Contents

if defined? DatabaseCleaner && defined? RSpec::Rails
  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, { :pre_count => true }
    end

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

    config.after(:each) do
      DatabaseCleaner.clean
    end
  end
else
  RSpec.configure do |config|
    config.use_transactional_fixtures = true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspectacular-0.2.0 lib/rspectacular/plugins/database_cleaner.rb
rspectacular-0.1.0 lib/rspectacular/plugins/database_cleaner.rb