Sha256: dcc9077ea08991c19cc52adceeedf1b5bfb2119e7b976f208a6d263ed9247a03

Contents?: true

Size: 499 Bytes

Versions: 2

Compression:

Stored size: 499 Bytes

Contents

require 'spec_helper'

describe 'create_table acts_as_superclass' do
  it 'creates foreign key and type columns' do
    name = Pen.acts_as_association_name
    expect(Pen.attribute_names).to include("#{name}_id")
    expect(Pen.attribute_names).to include("#{name}_type")
  end

  it 'when name passed creates foreign key and type columns with given name' do
    expect(Product.attribute_names).to include('producible_id')
    expect(Product.attribute_names).to include('producible_type')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_relation-1.1.3 spec/acts_as_superclass_spec.rb
acts_as_relation-1.1.2 spec/acts_as_superclass_spec.rb