Sha256: 9c34e50cabb573437ddda434058849e8de0071cbc568459d805660e839c7a9df

Contents?: true

Size: 768 Bytes

Versions: 13

Compression:

Stored size: 768 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe DattsRight, "when inheriting the definition of an association" do
  before do
    reset_database
    @category = Category.create
    @category.definition = {:teaser => {:object_type => "text"}, :price => {:object_type => "integer"}}
    @category.save
    @page = Page.create :category => @category
  end

  it "should create the dynamic attributes" do
    @page.teaser = "hi"
    @page.teaser.should == "hi"
    @page.price = 200
    @page.price.should == 200
  end

  it "should point to the dynamic attribute definition" do
    @page.datt_details(:teaser).definer.should == {:object_type => "text"}
    @page.datt_details(:price).definer.should == {:object_type => "integer"}
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
datts_right-0.0.32 spec/datts_right/inheritance_spec.rb
datts_right-0.0.31 spec/datts_right/inheritance_spec.rb
datts_right-0.0.30 spec/datts_right/inheritance_spec.rb
datts_right-0.0.29 spec/datts_right/inheritance_spec.rb
datts_right-0.0.28 spec/datts_right/inheritance_spec.rb
datts_right-0.0.27 spec/datts_right/inheritance_spec.rb
datts_right-0.0.26 spec/datts_right/inheritance_spec.rb
datts_right-0.0.25 spec/datts_right/inheritance_spec.rb
datts_right-0.0.24 spec/datts_right/inheritance_spec.rb
datts_right-0.0.23 spec/datts_right/inheritance_spec.rb
datts_right-0.0.22 spec/datts_right/inheritance_spec.rb
datts_right-0.0.21 spec/datts_right/inheritance_spec.rb
datts_right-0.0.20 spec/datts_right/inheritance_spec.rb