Blame view

test/portii_test.rb 856 Bytes
6a873e0f   chadzink   Implement PorTii ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  # frozen_string_literal: true
  
  require 'test_helper'
  
  class PorTiiTest < Minitest::Test
    extend Minitest::Spec::DSL
  
    let(:username) { ENV['SYSPRO_USERNAME'] }
    let(:password) { ENV['SYSPRO_PASSWORD'] }
    let(:company) { ENV['SYSPRO_COMPANY'] }
    let(:company_password) { '' }
    let(:user_id) do
      Syspro::Logon.logon(username, password, company, company_password)
    end
  
    def test_portii
      req = Syspro::BusinessObjects::PorTii.new
b1c0def6   Samuel J Clopton   rubocop violation...
18
  
6a873e0f   chadzink   Implement PorTii ...
19
      req.item_inspected = Syspro::BusinessObjects::Models::InventoryInspection.new
b1c0def6   Samuel J Clopton   rubocop violation...
20
      req.item_inspected.grn_number = 'P00012509'
6a873e0f   chadzink   Implement PorTii ...
21
      req.item_inspected.quantity = 12.312
b1c0def6   Samuel J Clopton   rubocop violation...
22
23
      req.item_inspected.inspection_completed = 'Y'
  
6a873e0f   chadzink   Implement PorTii ...
24
      resp = req.call(user_id.guid)
b1c0def6   Samuel J Clopton   rubocop violation...
25
26
27
28
  
      assert_equal resp.key?(:grn_numbers), true
      assert_equal resp.key?(:items_processed), true
      assert_equal resp.key?(:items_invalid), true
6a873e0f   chadzink   Implement PorTii ...
29
    end
b1c0def6   Samuel J Clopton   rubocop violation...
30
  end