Sha256: cc40c80b46afed299a61a3cabd6add3d2e2f4010a426d80c0a1ab80511cee4ab

Contents?: true

Size: 1003 Bytes

Versions: 10

Compression:

Stored size: 1003 Bytes

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

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

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
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

10 entries across 10 versions & 1 rubygems

Version Path
hydra-collections-2.0.4 spec/spec_helper.rb
hydra-collections-2.0.2 spec/spec_helper.rb
hydra-collections-2.0.1 spec/spec_helper.rb
hydra-collections-2.0.0 spec/spec_helper.rb
hydra-collections-1.3.2 spec/spec_helper.rb
hydra-collections-1.3.1 spec/spec_helper.rb
hydra-collections-1.3.0 spec/spec_helper.rb
hydra-collections-1.2.0 spec/spec_helper.rb
hydra-collections-1.2.0.rc1 spec/spec_helper.rb
hydra-collections-1.1.0 spec/spec_helper.rb