Sha256: bc02d18743f16537b3768cdbbf029cecd18a51dcc1e51892f91f0ec0d763d999

Contents?: true

Size: 886 Bytes

Versions: 2

Compression:

Stored size: 886 Bytes

Contents

require "spec_helper"

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

  it_should_use tag: :control, name: "control"

  for_attribute(:id, with_namespace: :r) do
    with_value("rId5") do
      it_should_assign_successfully
      it_should_output_regular_xml
    end

    with_value("") do
      it_should_raise_an_exception
    end
  end

  for_attribute(:unique_name, displays_as: :name, with_namespace: :w) do
    with_value("CheckBox1") do
      it_should_assign_successfully
      it_should_output_regular_xml
    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_regular_xml
    end

    with_value("") do
      it_should_raise_an_exception
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openxml-docx-0.10.1 spec/elements/control_spec.rb
openxml-docx-0.10.0 spec/elements/control_spec.rb