Sha256: bd68c20cdef2c327c9cf58c26a23d4dc569806318a80acd1bb1cff67abfa4f39

Contents?: true

Size: 897 Bytes

Versions: 5

Compression:

Stored size: 897 Bytes

Contents

require "spec_helper"

describe OpenXml::Docx::Elements::Control do
  include ElementTestMacros

  it_should_use tag: :control, name: "control"

  for_attribute(:id) do
    with_value("rId5") do
      it_should_assign_successfully
      it_should_output "<w:control r:id=\"rId5\"/>"
    end

    with_value("") do
      it_should_raise_an_exception
    end
  end

  for_attribute(:unique_name) do
    with_value("CheckBox1") do
      it_should_assign_successfully
      it_should_output "<w:control w:name=\"CheckBox1\"/>"
    end

    with_value("") do
      it_should_raise_an_exception
    end
  end

  for_attribute(:shape_id, displays_as: :shapeid, with_namespace: :w) do
    with_value("_x0000_s1027") do
      it_should_assign_successfully
      it_should_output "<w:control w:shapeid=\"_x0000_s1027\"/>"
    end

    with_value("") do
      it_should_raise_an_exception
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
openxml-docx-0.10.6 spec/elements/control_spec.rb
openxml-docx-0.10.5 spec/elements/control_spec.rb
openxml-docx-0.10.4 spec/elements/control_spec.rb
openxml-docx-0.10.3 spec/elements/control_spec.rb
openxml-docx-0.10.2 spec/elements/control_spec.rb