mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
fix misbehaving spec
This commit is contained in:
parent
353f154330
commit
e9eb812c9e
@ -6,10 +6,11 @@ describe ValidatesTimeliness::ActiveRecord::AttributeMethods do
|
||||
end
|
||||
|
||||
it "should define and call write method on first assign" do
|
||||
Person.class_eval { @generated_methods = Set.new }
|
||||
Person.send(:undef_method, :birth_date=)
|
||||
@person.should_receive(:write_date_time_attribute)
|
||||
@person.birth_date = "2000-01-01"
|
||||
Person.class_eval { @generated_methods = Set.new; @_defined_class_methods = nil }
|
||||
Person.send(:undef_method, :birth_date=) if Person.instance_methods.include?('birth_date=')
|
||||
person = Person.new
|
||||
person.should_receive(:write_date_time_attribute)
|
||||
person.birth_date = "2000-01-01"
|
||||
end
|
||||
|
||||
it "should call write_date_time_attribute when time attribute assigned value" do
|
||||
|
||||
Loading…
Reference in New Issue
Block a user