Blame view

test/por_test.rb 1.22 KB
810ca84b   Isaac Lewis   wip purchase orde...
1
2
3
4
  require 'test_helper'
  
  class PorTest < Minitest::Test
    extend Minitest::Spec::DSL
f4259c1e   Samuel J Clopton   fix tests and add...
5
  
810ca84b   Isaac Lewis   wip purchase orde...
6
7
8
    before { VCR.insert_cassette name }
    after { VCR.eject_cassette }
  
23108441   Nathan Ockerman   Replace sensitive...
9
10
11
    let(:username) { ENV['SYSPRO_USERNAME'] }
    let(:password) { ENV['SYSPRO_PASSWORD'] }
    let(:company) { ENV['SYSPRO_COMPANY'] }
810ca84b   Isaac Lewis   wip purchase orde...
12
    let(:company_password) { '' }
23108441   Nathan Ockerman   Replace sensitive...
13
  
810ca84b   Isaac Lewis   wip purchase orde...
14
15
16
17
    let(:user_id) do
      Syspro::Logon.logon(username, password, company, company_password)
    end
  
810ca84b   Isaac Lewis   wip purchase orde...
18
19
20
    def test_por_query
      porqry = Syspro::BusinessObjects::PorQry.new
  
f4259c1e   Samuel J Clopton   fix tests and add...
21
      porqry.purchase_order = ' 00001'
810ca84b   Isaac Lewis   wip purchase orde...
22
23
24
25
26
27
28
29
30
31
32
33
34
      porqry.include_stocked_lines = false
      porqry.include_non_stocked_lines = false
      porqry.include_freight_lines = false
      porqry.include_miscellaneous_lines = false
      porqry.include_comment_lines = false
      porqry.include_completed_lines = false
      porqry.include_grns = false
      porqry.include_history = false
      porqry.include_lct_details = false
      porqry.include_requisition_details = false
      porqry.include_requisition_routing = false
      porqry.include_sales_orders = false
      porqry.include_custom_forms = false
f4259c1e   Samuel J Clopton   fix tests and add...
35
36
      porqry.filter_type = 'A'
      porqry.filter_value = ''
810ca84b   Isaac Lewis   wip purchase orde...
37
38
  
      por_result = porqry.call(user_id.guid)
0e38c117   Chad Zink   Finished POR pars...
39
      assert_kind_of(Syspro::BusinessObjects::Models::PorDetail, por_result)
810ca84b   Isaac Lewis   wip purchase orde...
40
41
    end
  end