Fix undefine_attribute_methods spec

This commit is contained in:
Adam Meehan 2016-01-07 20:50:17 +11:00
parent 153051730b
commit 35caf3638e

View File

@ -241,8 +241,14 @@ RSpec.describe ValidatesTimeliness, 'ActiveRecord' do
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