require 'database_cleaner' require 'active_fedora/cleaner' RSpec.configure do |config| config.before :each do DatabaseCleaner.strategy = :transaction DatabaseCleaner.start end config.after do DatabaseCleaner.clean end config.before :each do |example| unless example.metadata[:type] == :view || example.metadata[:no_clean] ActiveFedora::Cleaner.clean! end end end