From 35caf3638edc53622dc8592b3bd307cfca8409d4 Mon Sep 17 00:00:00 2001 From: Adam Meehan Date: Thu, 7 Jan 2016 20:50:17 +1100 Subject: [PATCH] Fix undefine_attribute_methods spec --- spec/validates_timeliness/orm/active_record_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/validates_timeliness/orm/active_record_spec.rb b/spec/validates_timeliness/orm/active_record_spec.rb index c2334ced..c6d87574 100644 --- a/spec/validates_timeliness/orm/active_record_spec.rb +++ b/spec/validates_timeliness/orm/active_record_spec.rb @@ -241,8 +241,14 @@ class EmployeeWithParser < ActiveRecord::Base end context "undefine_attribute_methods" do - it "returns a falsy value if the attribute methods have already been generated" do - expect { Employee.undefine_attribute_methods }.to_not raise_error + it "returns remove attribute methods that have already been generated" do + Employee.define_attribute_methods + + expect(Employee.instance_methods).to include(:birth_datetime) + + Employee.undefine_attribute_methods + + expect(Employee.instance_methods).to_not include(:birth_datetime) end end end