mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 14:58:05 -05:00
Test different ORMs
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
ENV["RAILS_ENV"] = "test"
|
||||
require File.join(File.dirname(__FILE__), 'rails_app', 'config', 'environment')
|
||||
require 'rubygems'
|
||||
|
||||
ENV["RAILS_ENV"] = "test"
|
||||
DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
|
||||
require File.join(File.dirname(__FILE__), 'orm', DEVISE_ORM.to_s)
|
||||
|
||||
require 'test_help'
|
||||
require 'webrat'
|
||||
require 'mocha'
|
||||
|
||||
@@ -11,34 +13,7 @@ ActionMailer::Base.delivery_method = :test
|
||||
ActionMailer::Base.perform_deliveries = true
|
||||
ActionMailer::Base.default_url_options[:host] = 'test.com'
|
||||
|
||||
ActiveRecord::Migration.verbose = false
|
||||
ActiveRecord::Base.logger = Logger.new(nil)
|
||||
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
|
||||
|
||||
ActiveRecord::Schema.define(:version => 1) do
|
||||
[:users, :admins, :accounts].each do |table|
|
||||
create_table table do |t|
|
||||
t.authenticatable :null => table == :admins
|
||||
|
||||
if table != :admin
|
||||
t.string :username
|
||||
t.confirmable
|
||||
t.recoverable
|
||||
t.rememberable
|
||||
t.trackable
|
||||
end
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Webrat.configure do |config|
|
||||
config.mode = :rails
|
||||
config.open_error_files = false
|
||||
end
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
self.use_transactional_fixtures = true
|
||||
self.use_instantiated_fixtures = false
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user