Sha256: bd6ff89a92a792b15c2a88a57ec282e573527ab82bd83c5940691c9df5d80157

Contents?: true

Size: 513 Bytes

Versions: 16

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe DocTemplate::Tags::TaskTag do
  let(:node) { Nokogiri::HTML(original_content).at_xpath('*//p') }
  let(:original_content) { "<p><span>[task: #{task_number}]</span></p><p><span>" }
  let(:tag) { described_class.new }
  let(:task_number) { 2 }

  subject { tag.parse(node, value: task_number).content }

  it 'substitutes the tag' do
    expect(subject).to_not include '[task: '
    expect(subject).to include "<h4>Task #{task_number}</h4>"
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.5.4 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.5.3 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.5.2 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.5.1 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.5.0 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.4.2 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.4.1 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.4.0 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.3.1 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.1.4 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.3.0 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.1.3 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.2.0 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.1.2 spec/lib/doc_template/tags/task_tag_spec.rb
lcms-engine-0.1.0 spec/lib/doc_template/tags/task_tag_spec.rb