Sha256: 085c5d7cb3be4c7a2045ce443f5a95f3884987c20e9c6818ca6c74f060513ed8
Contents?: true
Size: 675 Bytes
Versions: 20
Compression:
Stored size: 675 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe DattsRight, ".attributes=" do before do reset_database @page = Page.create end it "should accept a mix of normal and dynamic attributes" do @page.add_dynamic_attribute(:price, "integer", 200) @page.attributes = {:name => "fark", :price => 300} @page.name.should == "fark" @page.read_datt(:price).should == 300 end it "should raise UnknownAttributeError if the attribute doesn't exist" do lambda { @page.attributes = {:name => "fark", :body => "lark"} }.should raise_error(ActiveRecord::UnknownAttributeError, "unknown attribute: body") end end
Version data entries
20 entries across 20 versions & 1 rubygems