lws 8.1.0 → 9.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
data/test/ticket_test.rb DELETED
@@ -1,131 +0,0 @@
1
- #
2
- # Copyright © 2016–2021 LeftClick Web Services B.V.
3
- #
4
- # This software is property of LeftClick Web Services B.V. and cannot be
5
- # redistributed and/or modified without permission. The software or any
6
- # of its parts cannot be used for any other purposes than the LeftClick
7
- # services and only during a valid license subscription. For more
8
- # information, please contact LeftClick Web Services B.V. at:
9
- # Schootense Dreef 20A, 5708 HZ Helmond, The Netherlands,
10
- # info@leftclick.eu, +3185-4444-004.
11
-
12
-
13
- require "test_helper"
14
-
15
- # FIXME: Cannot reach an attachment through the API yet
16
- #class TestTicketAttachment < MiniTest::Test
17
- #
18
- # include LWS::Ticket
19
- #
20
- # def setup
21
- # @ticket = Ticket.find(1)
22
- # @message = @ticket.messages.first
23
- # @attachment = @message.attachments.first
24
- # end
25
- #
26
- # def test_valid
27
- # refute_nil(@attachment)
28
- # assert_instance_of(Attachment, @attachment)
29
- # refute_nil(@attachment.id)
30
- # end
31
- #
32
- # def test_valid_associations
33
- # assert_instance_of(Messsage, @attachment.message)
34
- # assert_equal(@message, @attachment.message)
35
- # end
36
- #
37
- #end
38
-
39
- class TestTicketGroup < MiniTest::Test
40
-
41
- include LWS::Ticket
42
-
43
- def setup
44
- @group = Group.find(1)
45
- end
46
-
47
- def test_valid
48
- refute_nil(@group)
49
- assert_instance_of(Group, @group)
50
- refute_nil(@group.id)
51
- end
52
-
53
- def test_valid_associations
54
- # FIXME: Not implemented yet
55
- #assert_instance_of(Ticket, @group.tickets.first)
56
- end
57
-
58
- end
59
-
60
- class TestTicketMessage < MiniTest::Test
61
-
62
- include LWS::Ticket
63
-
64
- def setup
65
- @ticket = Ticket.find(1)
66
- # Messages only exist as child object of tickets
67
- @message = @ticket.messages.first
68
- end
69
-
70
- def test_valid_message
71
- refute_nil(@message)
72
- assert_instance_of(Message, @message)
73
- refute_nil(@message.id)
74
- end
75
-
76
- def test_valid_message_associations
77
- assert_instance_of(LWS::Auth::Account, @message.account)
78
- # FIXME: Cannot reach attachments through the API yet
79
- #assert_instance_of(Attachment, @message.attachments.first)
80
- assert_instance_of(LWS::Auth::Company, @message.company)
81
- assert_instance_of(Ticket, @message.ticket)
82
- assert_equal(@ticket, @message.ticket)
83
- end
84
-
85
- end
86
-
87
- class TestTicketTag < MiniTest::Test
88
-
89
- include LWS::Ticket
90
-
91
- def setup
92
- @tag = Tag.find(1)
93
- end
94
-
95
- def test_valid_tag
96
- refute_nil(@tag)
97
- assert_instance_of(Tag, @tag)
98
- refute_nil(@tag.id)
99
- end
100
-
101
- def test_valid_tag_associations
102
- assert_instance_of(Ticket, @tag.tickets.first)
103
- end
104
-
105
- end
106
-
107
- class TestTicketTicket < MiniTest::Test
108
-
109
- include LWS::Ticket
110
-
111
- def setup
112
- @ticket = Ticket.find(1)
113
- end
114
-
115
- def test_valid_ticket
116
- refute_nil(@ticket)
117
- assert_instance_of(Ticket, @ticket)
118
- refute_nil(@ticket.id)
119
- end
120
-
121
- def test_valid_ticket_associations
122
- assert_instance_of(LWS::Auth::Account, @ticket.account)
123
- assert_instance_of(LWS::Auth::Account, @ticket.assignee)
124
- assert_instance_of(LWS::Auth::Company, @ticket.company)
125
- assert_instance_of(Group, @ticket.group)
126
- assert_instance_of(Message, @ticket.messages.first)
127
- assert_instance_of(LWS::Auth::Company, @ticket.owner)
128
- assert_instance_of(Tag, @ticket.tags.first)
129
- end
130
-
131
- end