Sha256: f7156e203db4ff4b82433bf362780515cdb6d40e607af202c3445388bf1e30e8

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

require 'rubygems'

ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../dummy/config/environment", __FILE__)

require 'require_all'
require 'rspec/rails'
require 'cancan/matchers'
require 'database_cleaner'
require 'cutter'
require 'capybara/rails'
require 'capybara/rspec'
#require 'cantango/rspec'
#require 'factory_girl'
#require 'mocha'
#require 'factories'
#require 'controller_macros'
#Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

#ActiveRecord::Base.logger = Logger.new(STDERR)
DatabaseCleaner.strategy = :truncation
def migration_folder(name)
  migrations_path = File.dirname(__FILE__)
  name ? File.join("#{migrations_path}" "#{name}") : "#{migrations_path}/migrations"
end

def migrate(name = nil)
  mig_folder = migration_folder(name)
  ActiveRecord::Migrator.migrate mig_folder
end

RSpec.configure do |config|
  config.mock_with :rspec
  config.before(:suite) do
    DatabaseCleaner.strategy = :drop, {:include => ['migrations']}
    DatabaseCleaner.clean
    migrate("/dummy/db/migrate")
  end
end

# Overriden variant of Ability exposes some extra methods 
# to test caching:
require 'helpers/dummy_app_ability'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cantango-0.8.0 spec/dummy_spec_helper.rb