Sha256: 49a19f68dd881e875f187ed2175804c600d1532885d6b3e5b949d4bca6905cc4

Contents?: true

Size: 760 Bytes

Versions: 13

Compression:

Stored size: 760 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe DocTemplate::Tables::Activity do
  let(:table) { described_class.new }

  describe '#parse' do
    let(:data) { file_fixture('tables/activity-metadata-3activities.html').read }
    let(:html) { Lcms::Engine::HtmlSanitizer.sanitize(data) }
    let(:fragment) { Nokogiri::HTML.fragment html }

    subject { table.parse fragment }

    include_examples 'removes metadata table'

    it 'processed 3 acivities' do
      expect(subject.size).to eq 3
    end

    it 'processed data from acivities' do
      subject.each_with_index do |activity, idx|
        expect(activity['number'].to_i).to eq idx + 1
        expect(activity['class-configuration']).to eq 'Whole class'
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.5.4 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.5.3 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.5.2 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.5.1 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.5.0 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.4.2 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.4.1 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.4.0 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.3.1 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.1.4 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.3.0 spec/lib/doc_template/tables/activity_spec.rb
lcms-engine-0.1.3 spec/lib/doc_template/tables/activity_spec.rb