2009-08-29 02:49:18 -04:00
|
|
|
require "cases/helper"
|
|
|
|
|
2009-10-07 10:24:51 -04:00
|
|
|
class LintTest < ActiveModel::TestCase
|
|
|
|
include ActiveModel::Lint::Tests
|
|
|
|
|
|
|
|
class CompliantModel
|
2009-08-29 02:49:18 -04:00
|
|
|
def to_model
|
|
|
|
self
|
|
|
|
end
|
2009-10-07 10:24:51 -04:00
|
|
|
|
2009-08-29 02:49:18 -04:00
|
|
|
def valid?() true end
|
|
|
|
def new_record?() true end
|
|
|
|
def destroyed?() true end
|
2009-10-07 10:24:51 -04:00
|
|
|
|
2009-08-29 02:49:18 -04:00
|
|
|
def errors
|
|
|
|
obj = Object.new
|
|
|
|
def obj.[](key) [] end
|
|
|
|
def obj.full_messages() [] end
|
|
|
|
obj
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-10-07 10:24:51 -04:00
|
|
|
def setup
|
|
|
|
@model = CompliantModel.new
|
2009-08-29 02:49:18 -04:00
|
|
|
end
|
2009-09-25 01:56:20 -04:00
|
|
|
end
|