spec/attributes_spec.rb in simple_model-1.2.9 vs spec/attributes_spec.rb in simple_model-1.2.10
- old
+ new
@@ -244,17 +244,19 @@
has_boolean :foo
has_int :str
end
end
it "should merge defined attributes when class are inhereted" do
- NewerBase.defined_attributes[:bar].should_not be_nil
+ NewerBase.attribute_defined?(:bar).should be_true
n = NewerBase.new
n.respond_to?(:bar_will_change!).should be_true
end
it "should defaults that were not initialized should work from parent class" do
n = NewerBase.new
n.some.should eql(Date.today)
+ n.some = "2012-12-01"
+ n.some.should be_a(Date)
n.thing.should eql(Date.today)
end
it "should allow redefining methods in child classes" do
n = NewerBase.new