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

# setting textdomain at first. so it's available everywhere!
require 'fast_gettext'
FastGettext.text_domain = 'alchemy'

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

require 'database_cleaner'
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean

# Seed the database
Alchemy::Seeder.seed!

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"
Capybara.default_driver   = :rack_test
Capybara.default_selector = :css

# 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.mock_with :rspec
	config.use_transactional_fixtures = true
end

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

# setting textdomain at first. so it's available everywhere!
require 'fast_gettext'
FastGettext.text_domain = 'alchemy'

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

require 'database_cleaner'
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean

# Seed the database
Alchemy::Seeder.seed!

# Remove the config/alchemy path
FileUtils.rm_rf("#{Rails.root}/config/alchemy")

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"
Capybara.default_driver   = :rack_test
Capybara.default_selector = :css

# 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.mock_with :rspec
	config.use_transactional_fixtures = true
end

Remove config/alchemy folder of dummy app before running specs.
Remove config/alchemy folder of dummy app before running specs.
