query_test.rb
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require "test_helper"
class QueryTest < Minitest::Test
def test_query_browse
user_id = Syspro::Logon.logon("wland", "piperita2016", "L", "")
combrw = Syspro::BusinessObjects::ComBrw.new
combrw.browse_name = "InvMaster"
combrw.start_condition = ""
combrw.return_rows = 5
combrw.filters = []
combrw.table_name = "InvMaster"
combrw.title = "StockCodes"
combrw.columns = [
{name: "StockCode"}
]
browse_result = combrw.call(user_id.guid)
refute_nil browse_result
end
def test_query_query
user_id = Syspro::Logon.logon("wland", "piperita2016", "L", "")
comfnd = Syspro::BusinessObjects::ComFnd.new
comfnd.table_name = "InvMaster"
comfnd.return_rows = 5
comfnd.columns = [
{
name: "StockCode"
}
]
comfnd.expressions = [
{
andor: "And",
column: "StockCode",
condition: "EQ",
value: "02"
}
]
comfnd.order_by = "StockCode"
find_result = comfnd.call(user_id.guid)
refute_nil find_result
end
def test_query_fetch
user_id = Syspro::Logon.logon("wland", "piperita2016", "L", "")
comfch = Syspro::BusinessObjects::ComFch.new
comfch.table_name = "InvMaster"
comfch.key = "02"
comfch.optional_keys = []
comfch.full_key_provided = false
comfch.default_type = ""
comfch.espresso_fetch = true
fetch_result = comfch.call(user_id.guid)
refute_nil fetch_result
end
end