Blame view

test/portor_test.rb 1.09 KB
f1e2e13b   chadzink   Implemented PorTo...
1
2
3
4
5
6
7
  # frozen_string_literal: true
  
  require 'test_helper'
  
  class PorTorTest < Minitest::Test
    extend Minitest::Spec::DSL
  
f4259c1e   Samuel J Clopton   fix tests and add...
8
9
10
    before { VCR.insert_cassette name }
    after { VCR.eject_cassette }
  
f1e2e13b   chadzink   Implemented PorTo...
11
12
13
14
15
16
17
18
19
20
    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_portor
      receipt_intero = Syspro::BusinessObjects::Models::ReceiptInterospection.new
b1c0def6   Samuel J Clopton   rubocop violation...
21
22
23
      receipt_intero.purchase_order = 'Z01308'
      receipt_intero.warehouse = 'P0'
      receipt_intero.stock_code = '8801'
f4259c1e   Samuel J Clopton   fix tests and add...
24
      receipt_intero.quantity = 0.01
b1c0def6   Samuel J Clopton   rubocop violation...
25
26
27
      receipt_intero.delivery_note = 'DELIVER NOTE HERE-WL'
      receipt_intero.certificate = '8/45-3'
      receipt_intero.lot = '7097505'
f1e2e13b   chadzink   Implemented PorTo...
28
29
  
      req = Syspro::BusinessObjects::PorTor.new
b1c0def6   Samuel J Clopton   rubocop violation...
30
31
      req.transaction_date = Time.now.strftime('%Y-%m-%d')
      req.ignore_warnings = 'N'
f1e2e13b   chadzink   Implemented PorTo...
32
33
34
35
36
37
  
      req.receipt_interospections = [receipt_intero]
      resp = req.call(user_id.guid)
  
      assert_equal resp[:error_numbers].length, 0
    end
f4259c1e   Samuel J Clopton   fix tests and add...
38
  end