Sha256: 0a28adb4222a84328b3dc343ccf50babf37f2d73c56d079edd9fd8e7ca0da67a

Contents?: true

Size: 1.77 KB

Versions: 2

Compression:

Stored size: 1.77 KB

Contents

$: << File.join(File.dirname(__FILE__), '..', '..', 'lib' )

require 'simplecov'
SimpleCov.root File.join(File.dirname(__FILE__), "..", "..", "app_root" )
SimpleCov.start do
  add_filter "/config/"
  
  add_group 'Controllers', 'app/controllers'
  add_group 'Models', 'app/models'
  add_group 'Helpers', 'app/helpers'
  add_group 'Libraries', 'lib'
  add_group 'Plugins', 'vendor/plugins'
  add_group 'Migrations', 'db/migrate'
end

require 'spork'

Spork.prefork do
  # Set the default environment to sqlite3's in_memory database
  ENV['RAILS_ENV'] ||= 'in_memory'
  ENV['RAILS_ROOT'] = 'app_root'
  
  # Load the Rails environment and testing framework
  require "#{File.dirname(__FILE__)}/../config/environment"
  #require "#{File.dirname(__FILE__)}/../../init" # for plugins
  require 'rspec/rails'

  RSpec.configure do |config|
    config.use_transactional_fixtures = true
    config.use_instantiated_fixtures  = false
    config.include RSpec::Rails::ControllerExampleGroup, :example_group => { :file_path => /controller(.)*_spec.rb$/ }

    config.before(:suite) do
      ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate/core")
    end

    config.after(:suite) do
      ActiveRecord::Migrator.rollback("#{Rails.root}/db/migrate/core")
    end
  end
  
  #----------------------------------------------------------------
  # needed when running individual specs
  require File.join(File.dirname(__FILE__), '..','app','models','user')
  require File.join(File.dirname(__FILE__), '..','app','models','authentication')

  class TestUser < ActiveRecord::Base
    activate_sorcery!
  end

  class TestMailer < ActionMailer::Base

  end
  
  include ::Sorcery::TestHelpers
  include ::Sorcery::TestHelpers::Rails
  
end

Spork.each_run do
  # This code will be run each time you run your specs.
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sorcery-0.3.1 spec/rails3/app_root/spec/spec_helper.rb
sorcery-0.3.0 spec/rails3/app_root/spec/spec_helper.rb