Sha256: 59a9c034430f37df2929bfd8a75b58958d5573b24247c2485e10932ef59fd0e3

Contents?: true

Size: 1.49 KB

Versions: 2

Compression:

Stored size: 1.49 KB

Contents

require 'test_helper'
require 'ndr_import/file/acro_form'

module NdrImport
  module File
    # Acro Form file handler tests
    class AcroFormTest < ActiveSupport::TestCase
      def setup
        @permanent_test_files = SafePath.new('permanent_test_files')
      end

      test 'should read pdf correctly' do
        file_path = @permanent_test_files.join('acro_form.pdf')
        handler = NdrImport::File::AcroForm.new(file_path, nil)

        expected_row = { 'Group3'                      => nil,
                         'Textbox1_required'           => nil,
                         'Textbox2_required'           => nil,
                         'List Box_required'           => '3',
                         'Dropdown_required'           => '3',
                         'Textbox1_optional'           => nil,
                         'Textbox2_optional'           => nil,
                         'List Box_optional'           => '3',
                         'Dropdown_optional'           => '3',
                         'Date_required'               => nil,
                         'Date__optional'              => nil,
                         'Textbox3_numerical_required' => nil,
                         'Textbox3_numerical_optional' => nil }

        handler.tables.each do |tablename, sheet|
          assert_nil tablename
          assert_instance_of Enumerator, sheet
          assert_equal 1, sheet.to_a.size
          assert_equal expected_row, sheet.to_a.first
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ndr_import-8.5.0 test/file/acro_form_test.rb
ndr_import-8.4.0 test/file/acro_form_test.rb