Sha256: df2e37edaf86b9003ea0d25b9cf227f563e24658143b8294d7ad48bc15374792

Contents?: true

Size: 530 Bytes

Versions: 1

Compression:

Stored size: 530 Bytes

Contents

describe 'Single Table Inheritance' do
  
  before(:all) do
    fixtures(:people)
  end
  
  it "should save and load the correct Type" do
    database do
      ted = SalesPerson.new(:name => 'Ted')
      ted.save
    
      clone = Person.first(:name => 'Ted')
      ted.should == clone
      
      ted.should be_a_kind_of(SalesPerson)
    end
  end
  
  it "secondary database should inherit the same attributes" do
    
    database(:mock) do |db|
      db.table(SalesPerson)[:name].should_not be_nil
    end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datamapper-0.2.0 spec/single_table_inheritance_spec.rb