Blame view

test/comsfm_test.rb 872 Bytes
d9a9cb5d   chadzink   Add portoi and co...
1
2
3
4
5
6
7
  # frozen_string_literal: true
  
  require 'test_helper'
  
  class ComsFmTest < 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 }
  
d9a9cb5d   chadzink   Add portoi and co...
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_comsfm
      cust_item = Syspro::BusinessObjects::Models::ComsFmItem.new
b1c0def6   Samuel J Clopton   rubocop violation...
21
22
23
24
      cust_item.form_type = 'POR'
      cust_item.key_field = 'U03679'
      cust_item.field_name = 'TempPO'
      cust_item.alpha_value = 'Y'
d9a9cb5d   chadzink   Add portoi and co...
25
26
  
      cust_form = Syspro::BusinessObjects::ComsFm.new
b1c0def6   Samuel J Clopton   rubocop violation...
27
      cust_form.validate_only = 'Y'
d9a9cb5d   chadzink   Add portoi and co...
28
29
      cust_form.items = [cust_item]
  
762ae45f   chadzink   Added InvSws Busi...
30
      errors = cust_form.add(user_id.guid)
d9a9cb5d   chadzink   Add portoi and co...
31
32
33
  
      assert_equal errors.length, 0
    end
f4259c1e   Samuel J Clopton   fix tests and add...
34
  end