2009-10-09 20:11:58 -04:00
|
|
|
ENV["RAILS_ENV"] = "test"
|
2009-10-07 20:46:40 -04:00
|
|
|
require File.join(File.dirname(__FILE__), 'rails_app', 'config', 'environment')
|
2009-09-17 08:24:33 -04:00
|
|
|
|
2009-10-07 20:46:40 -04:00
|
|
|
require 'test_help'
|
|
|
|
require 'webrat'
|
|
|
|
|
2009-10-08 17:26:44 -04:00
|
|
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
2009-09-17 08:24:33 -04:00
|
|
|
|
2009-09-17 20:29:13 -04:00
|
|
|
ActionMailer::Base.delivery_method = :test
|
|
|
|
ActionMailer::Base.perform_deliveries = true
|
2009-10-08 10:31:51 -04:00
|
|
|
ActionMailer::Base.default_url_options[:host] = 'test.com'
|
2009-09-17 20:29:13 -04:00
|
|
|
|
|
|
|
ActiveRecord::Migration.verbose = false
|
2009-09-17 08:24:33 -04:00
|
|
|
ActiveRecord::Base.logger = Logger.new(nil)
|
|
|
|
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
|
|
|
|
ActiveRecord::Schema.define(:version => 1) do
|
2009-10-11 09:49:25 -04:00
|
|
|
[:users, :admins].each do |table|
|
|
|
|
create_table table do |t|
|
2009-10-22 17:26:10 -04:00
|
|
|
t.authenticable :null => table == :admins
|
2009-10-20 22:09:26 -04:00
|
|
|
|
2009-10-19 22:31:33 -04:00
|
|
|
if table == :users
|
2009-10-20 22:09:26 -04:00
|
|
|
t.confirmable
|
|
|
|
t.recoverable
|
|
|
|
t.rememberable
|
2009-10-19 22:31:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
t.timestamps
|
2009-10-11 09:49:25 -04:00
|
|
|
end
|
2009-10-10 08:32:51 -04:00
|
|
|
end
|
2009-09-17 08:24:33 -04:00
|
|
|
end
|
|
|
|
|
2009-10-07 20:46:40 -04:00
|
|
|
Webrat.configure do |config|
|
|
|
|
config.mode = :rails
|
2009-09-17 08:24:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
class ActiveSupport::TestCase
|
2009-10-07 20:46:40 -04:00
|
|
|
self.use_transactional_fixtures = true
|
|
|
|
self.use_instantiated_fixtures = false
|
2009-09-17 08:24:33 -04:00
|
|
|
end
|