Sha256: c0fdd36d78c8049346e96165219c1dd860fa8dc78a15c4c65af7480fb84a40ca

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
ENV["RAILS_ENV"] ||= 'test'

require File.expand_path("config/environment", ENV['RAILS_ROOT'] || File.expand_path("../internal", __FILE__))
require 'rspec/rails'
require 'hydra-collections'

FactoryGirl.definition_file_paths = [File.expand_path("../factories", __FILE__)]
FactoryGirl.find_definitions

# HttpLogger.logger = Logger.new(STDOUT)
# HttpLogger.ignore = [/localhost:8983\/solr/]
# HttpLogger.colorize = false
# # Patch for https://github.com/railsware/http_logger/issues/13
# HttpLogger::HTTP_METHODS_WITH_BODY = Set.new(%w(POST PUT GET PATCH))

module EngineRoutes
  def self.included(base)
    base.routes { Hydra::Collections::Engine.routes }
  end
end

require 'active_fedora/cleaner'
RSpec.configure do |config|
  config.use_transactional_fixtures = true
  config.include Devise::TestHelpers, :type => :controller
  config.before(:each, type: "controller") { @routes = Hydra::Collections::Engine.routes }
  config.include EngineRoutes, :type => :controller
  config.infer_spec_type_from_file_location!
  # Stub out test stuff.
  config.before(:each) do
    ActiveFedora::Cleaner.clean!
  end
end

module FactoryGirl
  def self.find_or_create(handle, by=:email)
    tmpl = FactoryGirl.build(handle)
    tmpl.class.send("find_by_#{by}".to_sym, tmpl.send(by)) || FactoryGirl.create(handle)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hydra-collections-4.0.0.beta1 spec/spec_helper.rb
hydra-collections-3.0.0.beta2 spec/spec_helper.rb
hydra-collections-3.0.0.beta1 spec/spec_helper.rb