lib/gemika/rspec.rb
##
# Configures RSpec to clean out the database before each example.
#
# Requires the `database_cleaner` gem to be added to your development dependencies.
#
Configures RSpec to clean out the database before each example.
Requires the `database_cleaner` gem to be added to your development dependencies.
Configures RSpec to clean out the database before each example . Requires the ` database_cleaner ` gem to be added to your development dependencies .
def configure_clean_database_before_example
      require 'database_cleaner' 
      configure do |config|
        config.before(:each) do
          DatabaseCleaner.clean_with(:truncation)
        end
      end
    end
def configure_clean_database_before_example require 'database_cleaner' configure do | config | config . before ( :each ) do DatabaseCleaner . clean_with ( :truncation ) end end end
Configures RSpec to clean out the database before each example.
Configures RSpec to clean out the database before each example .
# optional dependency # Truncation works across most database adapters; I had issues with :deletion and pg