spec/datt_spec.rb in datts_right-0.0.7 vs spec/datt_spec.rb in datts_right-0.0.8
- old
+ new
@@ -1,20 +1,20 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
-describe Datt do
+describe DynamicAttribute do
before do
reset_database
@page = Page.create
end
it "should allow transferring between String and Text" do
@page.add_dynamic_attribute(:foo, "string")
- @page.foo = "this is a string"
+ @page.write_dynamic_attribute :foo, "this is a string"
@page.save
- @page.foo = "t"*300
+ @page.write_dynamic_attribute :foo, "t"*300
@page.save
- @page.datts.find_by_attr_key("foo").object_type.should == "text"
- @page.foo = "this is a string again"
+ @page.dynamic_attributes.find_by_attr_key("foo").object_type.should == "text"
+ @page.write_dynamic_attribute :foo, "this is a string again"
@page.save
- @page.datts.find_by_attr_key("foo").object_type.should == "string"
+ @page.dynamic_attributes.find_by_attr_key("foo").object_type.should == "string"
end
end