configures database_cleaner
This commit is contained in:
4
Gemfile
4
Gemfile
@@ -50,3 +50,7 @@ group :development, :test do
|
||||
gem 'factory_girl_rails'
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem 'database_cleaner'
|
||||
end
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ GEM
|
||||
execjs
|
||||
coffee-script-source (1.9.1.1)
|
||||
columnize (0.9.0)
|
||||
database_cleaner (1.4.1)
|
||||
debug_inspector (0.0.2)
|
||||
devise (3.5.1)
|
||||
bcrypt (~> 3.0)
|
||||
@@ -203,6 +204,7 @@ DEPENDENCIES
|
||||
byebug
|
||||
capybara
|
||||
coffee-rails (~> 4.1.0)
|
||||
database_cleaner
|
||||
devise
|
||||
factory_girl_rails
|
||||
foundation-rails
|
||||
|
||||
@@ -4,6 +4,19 @@ RSpec.configure do |config|
|
||||
config.run_all_when_everything_filtered = true
|
||||
config.include FactoryGirl::Syntax::Methods
|
||||
|
||||
config.before(:suite) do
|
||||
DatabaseCleaner.clean_with :truncation
|
||||
DatabaseCleaner.strategy = :transaction
|
||||
end
|
||||
|
||||
config.before(:each) do
|
||||
DatabaseCleaner.start
|
||||
end
|
||||
|
||||
config.after(:each) do
|
||||
DatabaseCleaner.clean
|
||||
end
|
||||
|
||||
# Allows RSpec to persist some state between runs in order to support
|
||||
# the `--only-failures` and `--next-failure` CLI options.
|
||||
config.example_status_persistence_file_path = "spec/examples.txt"
|
||||
|
||||
Reference in New Issue
Block a user