Sha256: 1a3032dfa3f3e9f3108c549a508239ff52653246d2574b65c00444c9ec99ba2a

Contents?: true

Size: 1.61 KB

Versions: 2

Compression:

Stored size: 1.61 KB

Contents

# Configure Rails Environment
ENV["RAILS_ENV"] ||= "test"
require "bundler/setup"

if ENV['COVERAGE']
  require 'simplecov'
  SimpleCov.command_name "spec"
end

require File.expand_path("../../spec/dummy/config/environment.rb",  __FILE__)
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../spec/dummy/db/migrate", __FILE__)]
ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)

Rails.backtrace_cleaner.remove_silencers!

# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

$:.unshift File.join('..','spec','lib')
$:.unshift File.join('..','app','models','concerns')

require 'cancan'
require 'cul/omniauth/users'
require 'cul/omniauth/abilities'

# Load fixtures from the engine
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
  ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
end

def fixture_path(filename)
  path = File.join(File.dirname(__FILE__),'..','fixtures',filename)
end

def fixture(filename, mode="r")
  path = File.join(File.dirname(__FILE__),'..','fixtures',filename)
  if block_given?
    open(path, mode) {|io| yield io}
  else
    open(path, mode)
  end
end

def symbolize_hash_keys(hash)
  hash.symbolize_keys!
  hash.values.select{|v| v.is_a? Hash}.each{|h| symbolize_hash_keys(h)}
  hash
end

class DummyRequest
  attr_accessor :remote_ip
  attr_accessor :env
end
class Ability
  include CanCan::Ability
  include Cul::Omniauth::Abilities
end

class User
  attr_accessor :uid, :persisted
  def self.devise(*args); end
  def persisted?; persisted; end
  include Cul::Omniauth::Users
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cul_omniauth-0.5.1 spec/spec_helper.rb
cul_omniauth-0.5.0 spec/spec_helper.rb