Sha256: da74522080145428f3c382346c327d89f483aaee13ab5877d1e72aa514e66a36

Contents?: true

Size: 560 Bytes

Versions: 48

Compression:

Stored size: 560 Bytes

Contents

require 'rails_helper'

shared_examples_for :content_type do
  let(:model) { described_class }
  let(:klass) { model.to_s.underscore.to_sym }

  it '#column' do
    page = create(:page)
    page.content_rows << create(:content_row, rowable: page)
    row = page.content_rows.first
    type = create(klass)
    row.columns << create(:content_column, content_type: type.class, content_id: type.id)

    expect(type.column).to eq row.columns.take
  end

  it '#respond_to?' do
    expect(build(klass)).to respond_to(:column, :parent, :content_type_is?)
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
udongo-7.2.0 spec/support/concerns/content_type.rb
udongo-7.1.3 spec/support/concerns/content_type.rb
udongo-7.1.2 spec/support/concerns/content_type.rb
udongo-7.1.1 spec/support/concerns/content_type.rb
udongo-7.1.0 spec/support/concerns/content_type.rb
udongo-7.0.4 spec/support/concerns/content_type.rb
udongo-7.0.3 spec/support/concerns/content_type.rb
udongo-7.0.2 spec/support/concerns/content_type.rb
udongo-7.0.1 spec/support/concerns/content_type.rb
udongo-7.0.0 spec/support/concerns/content_type.rb
udongo-6.6.3 spec/support/concerns/content_type.rb
udongo-6.6.2 spec/support/concerns/content_type.rb
udongo-6.6.1 spec/support/concerns/content_type.rb
udongo-6.6.0 spec/support/concerns/content_type.rb
udongo-6.5.2 spec/support/concerns/content_type.rb
udongo-6.5.1 spec/support/concerns/content_type.rb
udongo-6.5.0 spec/support/concerns/content_type.rb
udongo-6.4.1 spec/support/concerns/content_type.rb
udongo-6.4.0 spec/support/concerns/content_type.rb
udongo-6.3.2 spec/support/concerns/content_type.rb