Sha256: f305c8db5cbf34c388dc06ea3d1aeab21a8e7e5adb1fdd48a2e0613e0b0de477
Contents?: true
Size: 1.05 KB
Versions: 35
Compression:
Stored size: 1.05 KB
Contents
# -*- encoding: utf-8 -*- require 'test_helper' require 'hexapdf/document' require 'hexapdf/type/acro_form/signature_field' describe HexaPDF::Type::AcroForm::SignatureField::LockDictionary do it "validates the presence of the /Fields key" do doc = HexaPDF::Document.new obj = HexaPDF::Type::AcroForm::SignatureField::LockDictionary.new({Action: :All}, document: doc) assert(obj.validate) obj[:Action] = :Include refute(obj.validate) end end describe HexaPDF::Type::AcroForm::SignatureField do before do @doc = HexaPDF::Document.new @field = @doc.wrap({}, type: :XXAcroFormField, subtype: :Sig) end it "sets the field value" do @field.field_value = {Empty: :True} assert_equal({Empty: :True}, @field[:V].value) end it "gets the field value" do @field[:V] = {Empty: :True} assert_equal({Empty: :True}, @field.field_value.value) end it "validates the value of the /FT field" do refute(@field.validate(auto_correct: false)) assert(@field.validate) assert_equal(:Sig, @field.field_type) end end
Version data entries
35 entries across 35 versions & 1 rubygems