Browse Source

faster tests with database_rewinder

pull/1/head
Nicolae Claudius 11 years ago
parent
commit
9558b11d69
  1. 2
      Gemfile
  2. 4
      Gemfile.lock
  3. 16
      spec/support/database_cleaner.rb
  4. 9
      spec/support/database_rewinder.rb

2
Gemfile

@ -68,7 +68,7 @@ end
group :test do
gem 'capybara', '~> 2.1.0'
gem 'database_cleaner', '~> 1.1.1'
gem 'database_rewinder', '~> 0.0.1'
# gem 'rb-inotify', '~> 0.9.0'
# gem 'libnotify', '~> 0.8.1'
# gem 'guard', '1.8.2'

4
Gemfile.lock

@ -128,7 +128,7 @@ GEM
sass (~> 3.1)
concerned_with (0.1.0)
dalli (2.6.4)
database_cleaner (1.1.1)
database_rewinder (0.0.1)
debase (0.0.7)
debugger-ruby_core_source
debug_inspector (0.0.2)
@ -285,7 +285,7 @@ DEPENDENCIES
compass-rails!
concerned_with (~> 0.1.0)
dalli (~> 2.6.2)
database_cleaner (~> 1.1.1)
database_rewinder (~> 0.0.1)
debase (~> 0.0.7)
detect_timezone_rails (~> 0.0.3)
devise (~> 3.0.3)

16
spec/support/database_cleaner.rb

@ -1,16 +0,0 @@
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end

9
spec/support/database_rewinder.rb

@ -0,0 +1,9 @@
RSpec.configure do |config|
config.before :suite do
DatabaseRewinder.clean_all
end
config.after do
DatabaseRewinder.clean
end
end
Loading…
Cancel
Save