Sha256: e82c871cebb982c999a7074497930165530020535f2b90e8d7a2ac576f315ced

Contents?: true

Size: 1.47 KB

Versions: 2

Compression:

Stored size: 1.47 KB

Contents

require 'test_helper'

module Workarea
  module Kount
    class EventTest < Workarea::TestCase
      def test_create
        assert_instance_of(Kount::DmcEvent, Event.create(dmc_xml))
        assert_instance_of(Kount::WorkflowEvent, Event.create(workflow_xml))
      end

      private

        def dmc_xml
          xml = <<~XML
            <event>
              <name>DMC_ADDRESS_ADD</name>
              <key>
                <address_1>Street Address </address_1>
                <address_2>Optional Address </address_2>
                <city>City </city>
                <state>State </state>
                <postal_code>Postal Code </postal_code>
                <type>Address Type </type>
              </key>
              <old_value>null </old_value>
              <new_value>New Status </new_value>
              <agent>agent@email.com </agent>
              <occurred>2015-09-05 13:19:24 </occurred>
            </event>
          XML

          Nokogiri::XML.parse(xml).children.first
        end

        def workflow_xml
          xml = <<~XML
            <event>
              <name>WORKFLOW_STATUS_EDIT</name>
              <key order_number="D58470FCF0" site="DEFAULT">7JG1075ML345</key>
              <old_value>R</old_value>
              <new_value>A</new_value>
              <agent>SYSTEM@KOUNT.NET</agent>
              <occurred>2018-05-18 06:47:47.413756</occurred>
            </event>
          XML

          Nokogiri::XML.parse(xml).children.first
        end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workarea-kount-3.3.1 test/services/workarea/kount/event_test.rb
workarea-kount-3.3.0 test/services/workarea/kount/event_test.rb