mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 07:16:41 +00:00
get the model to add errors to record returned from validation instead of validator
This commit is contained in:
@@ -46,37 +46,6 @@ describe ValidatesTimeliness::ValidationMethods do
|
||||
end
|
||||
end
|
||||
|
||||
# describe "timeliness_restriction_value" do
|
||||
# it "should return Time object when restriction is Time object" do
|
||||
# restriction_value(Time.now, person, :datetime).should be_kind_of(Time)
|
||||
# end
|
||||
#
|
||||
# it "should return Time object when restriction is string" do
|
||||
# restriction_value("2007-01-01 12:00", person, :datetime).should be_kind_of(Time)
|
||||
# end
|
||||
#
|
||||
# it "should return Time object when restriction is method symbol which returns Time object" do
|
||||
# person.stub!(:datetime_attr).and_return(Time.now)
|
||||
# restriction_value(:datetime_attr, person, :datetime).should be_kind_of(Time)
|
||||
# end
|
||||
#
|
||||
# it "should return Time object when restriction is method symbol which returns string" do
|
||||
# person.stub!(:datetime_attr).and_return("2007-01-01 12:00")
|
||||
# restriction_value(:datetime_attr, person, :datetime).should be_kind_of(Time)
|
||||
# end
|
||||
#
|
||||
# it "should return Time object when restriction is proc which returns Time object" do
|
||||
# restriction_value(lambda { Time.now }, person, :datetime).should be_kind_of(Time)
|
||||
# end
|
||||
#
|
||||
# it "should return Time object when restriction is proc which returns string" do
|
||||
# restriction_value(lambda {"2007-01-01 12:00"}, person, :datetime).should be_kind_of(Time)
|
||||
# end
|
||||
#
|
||||
# def restriction_value(*args)
|
||||
# ActiveRecord::Base.send(:timeliness_restriction_value, *args)
|
||||
# end
|
||||
# end
|
||||
|
||||
describe "with no restrictions" do
|
||||
before :all do
|
||||
|
||||
Reference in New Issue
Block a user