2011-02-08 17:16:35 +00:00
|
|
|
# Configure Rails Envinronment
|
|
|
|
ENV["RAILS_ENV"] = "test"
|
2009-05-27 15:21:20 +00:00
|
|
|
|
2011-02-08 17:16:35 +00:00
|
|
|
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
|
|
|
require "rails/test_help"
|
|
|
|
require 'shoulda'
|
2013-01-22 23:13:58 +00:00
|
|
|
require 'ffaker'
|
2009-05-27 15:21:20 +00:00
|
|
|
|
2013-10-03 14:06:24 +00:00
|
|
|
Rails.backtrace_cleaner.remove_silencers!
|
|
|
|
|
2011-02-08 17:16:35 +00:00
|
|
|
# Run any available migration
|
|
|
|
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
|
2010-03-18 18:02:55 +00:00
|
|
|
|
2011-02-08 17:16:35 +00:00
|
|
|
# Load support files
|
|
|
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
|
|
|
|
2011-04-07 00:21:57 +00:00
|
|
|
# global setup block resetting Thread.current
|
|
|
|
class ActiveSupport::TestCase
|
|
|
|
teardown do
|
|
|
|
Thread.current[:paper_trail] = nil
|
|
|
|
end
|
|
|
|
end
|
2011-02-08 17:16:35 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Helpers
|
|
|
|
#
|
2010-03-18 18:02:55 +00:00
|
|
|
|
2011-02-08 17:16:35 +00:00
|
|
|
def change_schema
|
|
|
|
ActiveRecord::Migration.verbose = false
|
|
|
|
ActiveRecord::Schema.define do
|
|
|
|
remove_column :widgets, :sacrificial_column
|
2012-03-12 11:12:27 +00:00
|
|
|
add_column :versions, :custom_created_at, :datetime
|
2010-03-19 18:53:49 +00:00
|
|
|
end
|
2011-02-08 17:16:35 +00:00
|
|
|
ActiveRecord::Migration.verbose = true
|
2010-03-19 18:53:49 +00:00
|
|
|
end
|