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-11-24 09:54:18 -05:00
|
|
|
require 'mocha'
|
2009-10-07 20:46:40 -04:00
|
|
|
|
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:")
|
2009-10-29 06:29:31 -04:00
|
|
|
|
2009-09-17 08:24:33 -04:00
|
|
|
ActiveRecord::Schema.define(:version => 1) do
|
2009-11-19 10:53:57 -05:00
|
|
|
[:users, :admins, :accounts].each do |table|
|
2009-10-11 09:49:25 -04:00
|
|
|
create_table table do |t|
|
2009-10-30 06:29:10 -04:00
|
|
|
t.authenticatable :null => table == :admins
|
2009-10-20 22:09:26 -04:00
|
|
|
|
2009-11-19 10:53:57 -05:00
|
|
|
if table != :admin
|
|
|
|
t.string :username
|
2009-10-20 22:09:26 -04:00
|
|
|
t.confirmable
|
|
|
|
t.recoverable
|
|
|
|
t.rememberable
|
2009-11-24 12:18:42 -05:00
|
|
|
t.trackable
|
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-11-22 19:19:29 -05:00
|
|
|
config.open_error_files = false
|
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
|