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:
Jacques Crocker
2010-03-27 16:15:23 -07:00
parent afe6a8c8c8
commit bb504e08aa
5 changed files with 65 additions and 6 deletions

4
test/orm/data_mapper.rb Normal file
View File

@@ -0,0 +1,4 @@
require File.expand_path('../../rails_app/config/environment', __FILE__)
require 'rails/test_help'
DataMapper.auto_migrate!

View 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

View 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