Sha256: ed1b41da56be38bfc3e3fddcadd78ae426e049d896bc58db4843364b755aa8c3

Contents?: true

Size: 586 Bytes

Versions: 16

Compression:

Stored size: 586 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe DocTemplate::Tags::TablePreserveAlignmentTag do
  let(:node) { Nokogiri::HTML(original_content).at_xpath('*//p') }
  let(:original_content) do
    <<-HTML
      <p><span>[#{described_class::TAG_NAME}]</span></p>
      <table><tr><td><p style="text-align:#{style}">sfdfdf</p></td></tr></table>
    HTML
  end
  let(:tag) { described_class.new }
  let(:style) { 'right' }

  subject { tag.parse(node).content }

  it 'add css class depends on text align' do
    expect(subject).to include %(class="text-#{style}")
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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