Sha256: f6ead324f21bfa5d1c83756d6e56291693bf705281d8e554dbbb1c69a6a88103

Contents?: true

Size: 1.28 KB

Versions: 6

Compression:

Stored size: 1.28 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

# require 'http_logger'
# HttpLogger.logger = Logger.new(STDOUT)
# HttpLogger.ignore = [/localhost:8983\/solr/]
# HttpLogger.colorize = false

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

6 entries across 6 versions & 1 rubygems

Version Path
hydra-collections-4.0.0.rc3 spec/spec_helper.rb
hydra-collections-4.0.0.rc2 spec/spec_helper.rb
hydra-collections-4.0.0.rc1 spec/spec_helper.rb
hydra-collections-4.0.0.beta4 spec/spec_helper.rb
hydra-collections-4.0.0.beta3 spec/spec_helper.rb
hydra-collections-4.0.0.beta2 spec/spec_helper.rb