Sha256: 02877ea464c3c6f36ccb08f6a1fc0c2e73c1e3c6943fbd3056b04cdae51ced8c

Contents?: true

Size: 1.42 KB

Versions: 1

Compression:

Stored size: 1.42 KB

Contents

begin
  require 'spork'
rescue LoadError => e
end

def configure
  # Configure Rails Environment
  ENV["RAILS_ENV"] = "test"

  require File.expand_path("../dummy/config/environment.rb", __FILE__)

  require 'database_cleaner'
  DatabaseCleaner.strategy = :truncation

  require 'authlogic/test_case'
  include Authlogic::TestCase

  require "rails/test_help"
  require "rspec/rails"
  require 'factory_girl'
  require 'factories.rb'

  ActionMailer::Base.delivery_method = :test
  ActionMailer::Base.perform_deliveries = true
  ActionMailer::Base.default_url_options[:host] = "test.com"

  Rails.backtrace_cleaner.remove_silencers!

  # Configure capybara for integration testing
  require "capybara/rails"
  require 'capybara-webkit'
  Capybara.default_driver = :rack_test
  Capybara.default_selector = :css
  Capybara.javascript_driver = :webkit

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

  RSpec.configure do |config|
    require 'rspec/expectations'
    config.include RSpec::Matchers
    config.include Alchemy::Engine.routes.url_helpers
    config.mock_with :rspec
    config.use_transactional_fixtures = true
  end

end

def seed
  # This code will be run each time you run your specs.
  DatabaseCleaner.clean
  # Seed the database
  Alchemy::Seeder.seed!
  ::I18n.locale = :en
end

if defined?(Spork)
  Spork.prefork { configure }
  Spork.each_run { seed }
else
  configure
  seed
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alchemy_cms-2.2.rc6 spec/spec_helper.rb