Sha256: ccb594d5a108115eafa72f0ed501c2667309c4309f3859b931006302edf1416e

Contents?: true

Size: 823 Bytes

Versions: 83

Compression:

Stored size: 823 Bytes

Contents

require 'spec_helper'

describe Tenon::TenonContent::Row do
  let(:row) { Tenon::TenonContent::Row.new }

  describe '#set_row_type' do
    it 'should set the row type' do
      row.stub(:build_pieces)
      expect(row).to receive(:row_type=).with('TestType')
      row.set_row_type('TestType')
    end

    it 'should build the pieces' do
      rtc = double
      row.stub(:row_type=)
      row.stub(:row_type_class) { rtc }
      expect(rtc).to receive(:add_pieces_to).with(row)
      row.set_row_type('TestType')
    end
  end

  describe '#row_type_class' do
    before do
      stub_const('Tenon::TenonContent::RowTypes::TestType', test_type)
    end
    let(:test_type) { double }

    it 'should return a const' do
      row.row_type = 'TestType'
      expect(row.row_type_class).to eq(test_type)
    end
  end

end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
tenon-1.1.8 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.1.7 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.1.6 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.1.5 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.1.4 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.1.3 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.1.2 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.1.1 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.76 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.75 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.74 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.73 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.72 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.71 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.70 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.69 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.68 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.67 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.66 spec/models/tenon/tenon_content/row_spec.rb
tenon-1.0.65 spec/models/tenon/tenon_content/row_spec.rb