Sha256: 43d1a45b4d2a7c183a58f509f78630689248214b0a9a880dd4379c3c5ac591d1
Contents?: true
Size: 819 Bytes
Versions: 27
Compression:
Stored size: 819 Bytes
Contents
begin require 'database_cleaner' require 'database_cleaner/cucumber' DatabaseCleaner.strategy = :truncation rescue NameError raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it." end if ::ActiveRecord::VERSION::MAJOR < 4 fixture_class = ActiveRecord::Fixtures else fixture_class = ActiveRecord::FixtureSet end fixtures_folder = File.join(Rails.root, 'test', 'fixtures') fixtures = Dir[File.join(fixtures_folder, '*.yml')].map {|f| File.basename(f, '.yml') } if defined? RailsCsvFixtures fixtures += Dir[File.join(fixtures_folder, '*.csv')].map {|f| File.basename(f, '.csv') } end Before do DatabaseCleaner.start fixture_class.create_fixtures(fixtures_folder, fixtures) end After do |scenario| fixture_class.reset_cache DatabaseCleaner.clean end
Version data entries
27 entries across 27 versions & 1 rubygems