mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 07:16:41 +00:00
fix generated_methods bug where read instead of write method stored
existing spec failed unless run alone as attribute methods already primed. fixed spec to undef method and empty generated_methods set
This commit is contained in:
@@ -5,7 +5,9 @@ describe ValidatesTimeliness::ActiveRecord::AttributeMethods do
|
||||
@person = Person.new
|
||||
end
|
||||
|
||||
it "should call write_date_time_attribute when date attribute assigned value" do
|
||||
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"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user