# Configure Rails Environment ENV["RAILS_ENV"] ||= 'test' if ENV['COVERAGE'] require 'simplecov' SimpleCov.start 'rails' SimpleCov.command_name "spec" end require File.expand_path("../internal/config/environment.rb", __FILE__) # Prevent double spec runs under Zeus require 'rspec/autorun' unless ENV['RUNNING_VIA_ZEUS'] require File.expand_path('../spec_patch', __FILE__) require 'curate/spec_support' require 'database_cleaner' require 'curate/internal/factories' Rails.backtrace_cleaner.remove_silencers! # This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # Require this file using `require "spec_helper"` to ensure that it is only # loaded once. # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered = true config.fixture_path = File.expand_path("../fixtures", __FILE__) # Run specs in random order to surface order dependencies. If you find an # order dependency and want to debug it, you can fix the order by providing # the seed, which is printed after each run. # --seed 1234 config.order = 'random' config.include Devise::TestHelpers, type: :controller config.include InputSupport, type: :input, example_group: { file_path: config.escaped_path(%w[spec inputs]) } config.use_transactional_fixtures = false config.before(:suite) do ActiveFedora::Base.destroy_all DatabaseCleaner.strategy = :truncation DatabaseCleaner.clean_with(:truncation) end config.before(:each) do DatabaseCleaner.start end config.after(:each) do DatabaseCleaner.clean end end