mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-23 05:38:04 -05:00
Initial Datamapper test suite
Test suite runs, however there's still some failing tests. This allows us to at least have a working test suite so they can fix these datamapper spec failures individually.
This commit is contained in:
4
test/orm/data_mapper.rb
Normal file
4
test/orm/data_mapper.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
require File.expand_path('../../rails_app/config/environment', __FILE__)
|
||||
require 'rails/test_help'
|
||||
|
||||
DataMapper.auto_migrate!
|
||||
17
test/rails_app/app/data_mapper/admin.rb
Normal file
17
test/rails_app/app/data_mapper/admin.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class Admin
|
||||
include DataMapper::Resource
|
||||
|
||||
property :id, Serial
|
||||
property :username, String
|
||||
|
||||
devise :authenticatable, :registerable, :timeoutable, :recoverable
|
||||
|
||||
def self.find_for_authentication(conditions)
|
||||
last(conditions)
|
||||
end
|
||||
|
||||
def self.create!(*args)
|
||||
create(*args)
|
||||
end
|
||||
|
||||
end
|
||||
21
test/rails_app/app/data_mapper/user.rb
Normal file
21
test/rails_app/app/data_mapper/user.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
class User
|
||||
include DataMapper::Resource
|
||||
|
||||
property :id, Serial
|
||||
property :username, String
|
||||
|
||||
devise :authenticatable, :http_authenticatable, :confirmable, :lockable, :recoverable,
|
||||
:registerable, :rememberable, :timeoutable, :token_authenticatable,
|
||||
:trackable
|
||||
|
||||
# :validatable disabled for now
|
||||
timestamps :at
|
||||
|
||||
def save!(*args)
|
||||
save
|
||||
end
|
||||
|
||||
def self.create!(*args)
|
||||
create(*args)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user