Blame view

test/sor_test.rb 1.11 KB
d9177f32   Isaac Lewis   create sor model;...
1
2
3
4
5
6
7
8
9
  # frozen_string_literal: true
  
  require 'test_helper'
  
  class SorTest < Minitest::Test
    extend Minitest::Spec::DSL
    before { VCR.insert_cassette name }
    after { VCR.eject_cassette }
  
23108441   Nathan Ockerman   Replace sensitive...
10
11
12
    let(:username) { ENV['SYSPRO_USERNAME'] }
    let(:password) { ENV['SYSPRO_PASSWORD'] }
    let(:company) { ENV['SYSPRO_COMPANY'] }
d9177f32   Isaac Lewis   create sor model;...
13
    let(:company_password) { '' }
23108441   Nathan Ockerman   Replace sensitive...
14
  
d9177f32   Isaac Lewis   create sor model;...
15
16
17
18
19
    let(:user_id) do
      Syspro::Logon.logon(username, password, company, company_password)
    end
  
    def test_sor_query
b0dddc7f   Isaac Lewis   change from sorqb...
20
      sorqbs = Syspro::BusinessObjects::SorQry.new
d9177f32   Isaac Lewis   create sor model;...
21
  
b0dddc7f   Isaac Lewis   change from sorqb...
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
      sorqbs.sales_order = '16R069'
      sorqbs.invoice = nil
      sorqbs.stocked_lines = true
      sorqbs.non_stocked_lines = true
      sorqbs.freight_lines = true
      sorqbs.misc_lines = true
      sorqbs.comment_lines = true
      sorqbs.completed_lines = true
      sorqbs.serials = true
      sorqbs.lots = true
      sorqbs.bins = true
      sorqbs.attached_items = true
      sorqbs.custom_forms = true
      sorqbs.detail_line_custom_forms = true
      sorqbs.values = true
      sorqbs.line_ship_date = true
d9177f32   Isaac Lewis   create sor model;...
38
39
  
      sor_result = sorqbs.call(user_id.guid)
23108441   Nathan Ockerman   Replace sensitive...
40
  
b0dddc7f   Isaac Lewis   change from sorqb...
41
      assert_kind_of Syspro::BusinessObjects::Models::SorDetail, sor_result
d9177f32   Isaac Lewis   create sor model;...
42
43
    end
  end