osc_ruby 0.7.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +25 -25
  3. data/.gitignore +15 -15
  4. data/.rspec +1 -1
  5. data/.rubocop.yml +1156 -1156
  6. data/.travis.yml +9 -9
  7. data/Gemfile +3 -3
  8. data/License.txt +21 -0
  9. data/README.md +95 -242
  10. data/Rakefile +2 -2
  11. data/lib/ext/string.rb +18 -18
  12. data/lib/osc_ruby/classes/query_results.rb +40 -60
  13. data/lib/osc_ruby/client.rb +40 -40
  14. data/lib/osc_ruby/configuration.rb +14 -13
  15. data/lib/osc_ruby/connect.rb +218 -209
  16. data/lib/osc_ruby/modules/normalize_module.rb +121 -121
  17. data/lib/osc_ruby/modules/query_module.rb +69 -69
  18. data/lib/osc_ruby/modules/validations_module.rb +168 -168
  19. data/lib/osc_ruby/version.rb +2 -2
  20. data/lib/osc_ruby.rb +4 -10
  21. data/osc_ruby.gemspec +28 -29
  22. data/spec/core/client_spec.rb +96 -96
  23. data/spec/core/configuration_spec.rb +4 -4
  24. data/spec/core/connect_spec.rb +366 -364
  25. data/spec/core/query_results_spec.rb +107 -133
  26. data/spec/core/spec_helper.rb +25 -25
  27. data/tasks/rspec.rake +2 -2
  28. metadata +23 -22
  29. data/LICENSE.txt +0 -22
  30. data/lib/osc_ruby/classes/account.rb +0 -75
  31. data/lib/osc_ruby/classes/answer.rb +0 -117
  32. data/lib/osc_ruby/classes/incident.rb +0 -13
  33. data/lib/osc_ruby/classes/product_category_shared.rb +0 -118
  34. data/lib/osc_ruby/classes/service_category.rb +0 -6
  35. data/lib/osc_ruby/classes/service_class.rb +0 -66
  36. data/lib/osc_ruby/classes/service_product.rb +0 -6
  37. data/lib/osc_ruby/modules/class_factory_module.rb +0 -165
  38. data/lib/osc_ruby/modules/nested_resource_module.rb +0 -10
  39. data/spec/core/account_spec.rb +0 -497
  40. data/spec/core/answer_spec.rb +0 -545
  41. data/spec/core/service_category_spec.rb +0 -445
  42. data/spec/core/service_product_spec.rb +0 -443
@@ -1,497 +0,0 @@
1
- require 'core/spec_helper'
2
- require 'json'
3
- require 'uri'
4
-
5
- describe OSCRuby::Account do
6
-
7
- let(:account){
8
-
9
- OSCRuby::Account.new
10
-
11
- }
12
-
13
- context '#initialize' do
14
-
15
- it 'should not throw an error when initialized' do
16
-
17
- expect{account}.not_to raise_error
18
-
19
- end
20
-
21
- it 'should initialize with a displayName as a string, login as a string, name as a hash, nameFurigana as a hash, attributes as a hash, profile as a hash,staffGroup as a hash, newPassword as a string, country as a hash, emails as an array' do
22
-
23
- expect(account.displayName).to be_a(String)
24
- expect(account.login).to be_a(String)
25
- expect(account.name).to be_a(Hash)
26
- expect(account.nameFurigana).to be_a(Hash)
27
- expect(account.attributes).to be_a(Hash)
28
- expect(account.profile).to be_a(Hash)
29
- expect(account.staffGroup).to be_a(Hash)
30
- expect(account.newPassword).to be_a(String)
31
- expect(account.country).to be_a(Hash)
32
- expect(account.emails).to be_an(Array)
33
-
34
- end
35
-
36
- end
37
-
38
- # let(:attributes){
39
- #
40
- #
41
- # }
42
-
43
- # context '#new_from_fetch' do
44
-
45
- # it 'should accept an attributes as a hash' do
46
-
47
- # expect do
48
-
49
- # attributes = []
50
-
51
- # OSCRuby::Account.new_from_fetch(attributes)
52
-
53
- # end.to raise_error("Attributes must be a hash; please use the appropriate data structure")
54
-
55
- # expect do
56
-
57
- # OSCRuby::Account.new_from_fetch(attributes)
58
-
59
- # end.not_to raise_error
60
-
61
- # end
62
-
63
- # it 'should instantiate an id, lookupName, createdTime, updatedTime, accessLevels, adminLastAccessTime, answerType, expiresDate, guidedAssistance, keywords, language, lastAccessTime, lastNotificationTime, name, nextNotificationTime, originalReferenceNumber, positionInList, publishOnDate, question, solution, summary, updatedByAccount, uRL with the correct values' do
64
-
65
- # test = OSCRuby::Account.new_from_fetch(attributes)
66
-
67
- # expect(test.id).to eq(2222)
68
- # expect(test.lookupName).to eq(2222)
69
- # expect(test.createdTime).to eq("2014-02-05T23:42:28Z")
70
- # expect(test.updatedTime).to eq("2016-12-13T09:55:45Z")
71
- # expect(test.accessLevels).to eq(3)
72
- # expect(test.adminLastAccessTime).to eq("2016-11-23T22:54:26Z")
73
- # expect(test.answerType).to eq(1)
74
- # expect(test.expiresDate).to eq(nil)
75
- # expect(test.guidedAssistance).to eq(nil)
76
- # expect(test.keywords).to eq("AbCbEbAb")
77
- # expect(test.language).to eq(1)
78
- # expect(test.lastAccessTime).to eq("2016-12-10T07:27:37Z")
79
- # expect(test.lastNotificationTime).to eq(nil)
80
- # expect(test.name).to eq(2222)
81
- # expect(test.nextNotificationTime).to eq(nil)
82
- # expect(test.originalReferenceNumber).to eq(nil)
83
- # expect(test.positionInList).to eq(1)
84
- # expect(test.publishOnDate).to eq(nil)
85
- # expect(test.question).to eq(nil)
86
- # expect(test.solution).to eq("<p ></iframe></p>\n<ol>\n<li>\n<div class=\"MsoNormal\" >The following video will show you how to view your DVR using the QT view app or through a Browser using the Q-See Scan n View P2P technology.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step1.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >P2P equals Peer to Peer. This concept has been around for a long time.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step2.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >P2P equals Peer to Peer. In a peer to peer network, tasks (such as searching for files or streaming audio/video) are shared amongst multiple interconnected peers who each make a portion of their resources (such as processing power, Disk Storage or network bandwidth) directly available to other Network participants, without the need for centralized coordination by servers.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step3.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Q-See's application is to take the Port Forwarding process out of the hands of the End User.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step4.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Next, you will need to install your QT View app via the Apple App Store or the Google Play Store.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step5.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Once the DVR is connected and is powered up, you will go through the wizard.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6.png\" /></p>\n<div class=\"MsoNormal\" ></div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6a.png\" /></p>\n<div class=\"MsoNormal\" ></div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6b.png\" /></p>\n<div class=\"MsoNormal\" ></div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6c.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >While going through the wizard you will need to select your device to fit the the QR Code.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6d.png\" /></p>\n<div class=\"MsoNormal\" ></div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6e.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Then go to your QT View and tap on the QR code image.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step7.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Now, your scanner will come up, then scan the QR code.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step8.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >The MAC address will appear, then enter the DVR's user name and password.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step9.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Then Tap Login.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step10.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >After a few moments you will then be able to see the cameras without having to access the router.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step11.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >How to access it for PC/MAC.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step12.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Open Browser. Enter qtview.com, Push enter. NOTE: YOU WILL STILL NEED TO ADD IN THE ACTIVE X OR IE PLUG IN FOR YOUR BROWSER.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step13.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Enter the MAC address, User name, and Password, then click LOGIN.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step14.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Then you will be able to see your system.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step15.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Q-See Scan n View.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step16.png\" /></p>\n</li>\n</ol>")
87
- # expect(test.summary).to eq("QT Series: (VIDEO) Scan 'N View Setup")
88
- # expect(test.updatedByAccount).to eq(47)
89
- # expect(test.uRL).to eq(nil)
90
-
91
- # end
92
-
93
- # end
94
-
95
- let(:client) {
96
-
97
- OSCRuby::Client.new do |config|
98
-
99
- config.interface = ENV['OSC_TEST1_SITE']
100
-
101
- config.username = ENV['OSC_ADMIN']
102
-
103
- config.password = ENV['OSC_PASSWORD']
104
-
105
- end
106
- }
107
-
108
- # let(:new_answer){
109
- # OSCRuby::Account.new
110
- # }
111
-
112
- # context '#create' do
113
-
114
- # it 'should expect client is an instance of OSCRuby::Client class and raise an error if does not' do
115
-
116
- # expect(client).to be_an(OSCRuby::Client)
117
-
118
- # client = nil
119
-
120
- # expect{new_answer.create(client)}.to raise_error('Client must have some configuration set; please create an instance of OSCRuby::Client with configuration settings')
121
-
122
- # end
123
-
124
- # it 'should check the object and make sure that it at least has a language, answerType, and summary set', :vcr do
125
-
126
- # expect{new_answer.create(client)}.to raise_error('Answer should at least the language, answerType, and summary set (new_answer.language = {"id" => 1}; new_answer.answerType = {"id" => 1}}; new_answer.summary = "This is the Answer Title")')
127
-
128
- # new_answer.language['id'] = 1
129
-
130
- # expect{new_answer.create(client)}.to raise_error('Answer should at least the language, answerType, and summary set (new_answer.language = {"id" => 1}; new_answer.answerType = {"id" => 1}}; new_answer.summary = "This is the Answer Title")')
131
-
132
- # new_answer.answerType['id'] = 1
133
-
134
- # # the Answer summary is defaulted to "Answer summary text" so it should pass here
135
-
136
- # expect{new_answer.create(client)}.to_not raise_error
137
-
138
- # end
139
-
140
- # it 'should expect the language as a hash with an id as a key with a value of a number' do
141
-
142
- # new_answer.language['id'] = "new answer name"
143
- # new_answer.answerType['id'] = 1
144
-
145
- # expect{new_answer.create(client)}.to raise_error('Answer should at least the language, answerType, and summary set (new_answer.language = {"id" => 1}; new_answer.answerType = {"id" => 1}}; new_answer.summary = "This is the Answer Title")')
146
-
147
- # end
148
-
149
- # it 'should expect the answerType as a hash with an id as a key with a value of a number' do
150
-
151
- # new_answer.language['id'] = 1
152
- # new_answer.answerType['id'] = "new answer name"
153
-
154
- # expect{new_answer.create(client)}.to raise_error('Answer should at least the language, answerType, and summary set (new_answer.language = {"id" => 1}; new_answer.answerType = {"id" => 1}}; new_answer.summary = "This is the Answer Title")')
155
-
156
- # end
157
-
158
- # it 'should expect the answerType as a hash with an lookupName as a key with a value of "HTML","URL", or "File Attachment"', :vcr do
159
-
160
- # new_answer.language['id'] = 1
161
- # new_answer.answerType['lookupName'] = "HTML"
162
-
163
- # expect{new_answer.create(client)}.not_to raise_error
164
-
165
- # end
166
-
167
- # it 'should expect the categories to be an array' do
168
-
169
- # expect(new_answer.categories).to be_an(Array)
170
-
171
- # end
172
-
173
- # it 'should expect that a hash with an id key for categories should create an answer without issue', :vcr do
174
-
175
- # new_answer.language['id'] = 1
176
- # new_answer.answerType['lookupName'] = "HTML"
177
-
178
- # new_answer.categories[0] = {'id' => 6}
179
-
180
- # new_answer.create(client)
181
-
182
- # expect(new_answer).to be_a(OSCRuby::Account)
183
-
184
- # end
185
-
186
- # it 'should return an instance of an OSCRuby::Account if the json_response param is set to false (which it is by default)', :vcr do
187
-
188
- # new_answer.language['id'] = 1
189
- # new_answer.answerType['lookupName'] = "HTML"
190
-
191
- # new_answer.create(client)
192
-
193
- # expect(new_answer).to be_a(OSCRuby::Account)
194
-
195
- # expect(new_answer.summary).to eq("Answer summary text")
196
-
197
- # expect(new_answer.language).to eq({"id"=>1, "lookupName"=>"en_US"})
198
-
199
- # end
200
-
201
-
202
- # it 'should return the body object if the json_response param is set to true', :vcr do
203
-
204
- # new_answer.language['id'] = 1
205
- # new_answer.answerType['lookupName'] = "HTML"
206
-
207
- # expect(new_answer.create(client,true)).to be_a(String)
208
-
209
- # end
210
-
211
- # end
212
-
213
- # context '#find' do
214
-
215
- # it 'should expect client is an instance of OSCRuby::Client class and raise an error if does not' do
216
-
217
- # expect(client).to be_an(OSCRuby::Client)
218
-
219
- # client = nil
220
-
221
- # expect{OSCRuby::Account.find(client,100)}.to raise_error('Client must have some configuration set; please create an instance of OSCRuby::Client with configuration settings')
222
-
223
- # end
224
-
225
- # it 'should raise an error if ID is undefined' do
226
-
227
- # expect{OSCRuby::Account.find(client)}.to raise_error('ID cannot be nil')
228
-
229
- # end
230
-
231
- # it 'should raise an error if ID is not an integer' do
232
-
233
- # expect{OSCRuby::Account.find(client, 'a')}.to raise_error('ID must be an integer')
234
-
235
- # end
236
-
237
- # it 'should return a warning if empty/no instances of the object can be found', :vcr do
238
-
239
- # expect{OSCRuby::Account.find(client, 100)}.to raise_error('There were no objects matching your query; please try again.')
240
-
241
- # end
242
-
243
-
244
- # it 'should return an instance of a new OSCRuby::Account object with at least a name and displayOrder', :vcr do
245
-
246
- # known_working_answer = OSCRuby::Account.find(client, 2222)
247
-
248
- # expect(known_working_answer).to be_an(OSCRuby::Account)
249
- # expect(known_working_answer.id).to eq(2222)
250
- # expect(known_working_answer.lookupName).to eq(2222)
251
- # expect(known_working_answer.createdTime).to eq("2014-02-05T23:42:28Z")
252
- # expect(known_working_answer.updatedTime).to eq("2016-12-13T09:55:45Z")
253
- # expect(known_working_answer.accessLevels).to eq(3)
254
- # expect(known_working_answer.adminLastAccessTime).to eq("2016-11-23T22:54:26Z")
255
- # expect(known_working_answer.answerType).to eq(1)
256
- # expect(known_working_answer.expiresDate).to eq(nil)
257
- # expect(known_working_answer.guidedAssistance).to eq(nil)
258
- # expect(known_working_answer.keywords).to eq("AbCbEbAb")
259
- # expect(known_working_answer.language).to eq(1)
260
- # expect(known_working_answer.lastAccessTime).to eq("2016-12-10T07:27:37Z")
261
- # expect(known_working_answer.lastNotificationTime).to eq(nil)
262
- # expect(known_working_answer.name).to eq(2222)
263
- # expect(known_working_answer.nextNotificationTime).to eq(nil)
264
- # expect(known_working_answer.originalReferenceNumber).to eq(nil)
265
- # expect(known_working_answer.positionInList).to eq(1)
266
- # expect(known_working_answer.publishOnDate).to eq(nil)
267
- # expect(known_working_answer.question).to eq(nil)
268
- # expect(known_working_answer.solution).to eq("<p ></iframe></p>\n<ol>\n<li>\n<div class=\"MsoNormal\" >The following video will show you how to view your DVR using the QT view app or through a Browser using the Q-See Scan n View P2P technology.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step1.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >P2P equals Peer to Peer. This concept has been around for a long time.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step2.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >P2P equals Peer to Peer. In a peer to peer network, tasks (such as searching for files or streaming audio/video) are shared amongst multiple interconnected peers who each make a portion of their resources (such as processing power, Disk Storage or network bandwidth) directly available to other Network participants, without the need for centralized coordination by servers.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step3.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Q-See's application is to take the Port Forwarding process out of the hands of the End User.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step4.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Next, you will need to install your QT View app via the Apple App Store or the Google Play Store.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step5.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Once the DVR is connected and is powered up, you will go through the wizard.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6.png\" /></p>\n<div class=\"MsoNormal\" ></div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6a.png\" /></p>\n<div class=\"MsoNormal\" ></div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6b.png\" /></p>\n<div class=\"MsoNormal\" ></div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6c.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >While going through the wizard you will need to select your device to fit the the QR Code.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6d.png\" /></p>\n<div class=\"MsoNormal\" ></div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step6e.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Then go to your QT View and tap on the QR code image.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step7.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Now, your scanner will come up, then scan the QR code.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step8.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >The MAC address will appear, then enter the DVR's user name and password.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step9.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Then Tap Login.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step10.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >After a few moments you will then be able to see the cameras without having to access the router.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step11.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >How to access it for PC/MAC.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step12.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Open Browser. Enter qtview.com, Push enter. NOTE: YOU WILL STILL NEED TO ADD IN THE ACTIVE X OR IE PLUG IN FOR YOUR BROWSER.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step13.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Enter the MAC address, User name, and Password, then click LOGIN.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step14.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Then you will be able to see your system.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step15.png\" /></p>\n</li>\n<li>\n<div class=\"MsoNormal\" >Q-See Scan n View.</div>\n<p align=\"center\"><img border=\"0\" alt=\"Image\" src=\"//q-see.s3.amazonaws.com/content/files/HowToFiles/p2pimages/Step16.png\" /></p>\n</li>\n</ol>")
269
- # expect(known_working_answer.summary).to eq("QT Series: (VIDEO) Scan 'N View Setup")
270
- # expect(known_working_answer.updatedByAccount).to eq(47)
271
- # expect(known_working_answer.uRL).to eq(nil)
272
-
273
- # end
274
-
275
- # it 'should return the raw json response if the return_json parameter is set to true', :vcr do
276
-
277
- # known_working_answer_in_json = OSCRuby::Account.find(client, 2222, true)
278
-
279
- # expect(known_working_answer_in_json).to be_an(String)
280
-
281
- # end
282
-
283
- # end
284
-
285
- # context '#all' do
286
-
287
- # it 'should expect client is an instance of OSCRuby::Client class and raise an error if does not' do
288
-
289
- # expect(client).to be_an(OSCRuby::Client)
290
-
291
- # client = nil
292
-
293
- # expect{OSCRuby::Account.all(client)}.to raise_error('Client must have some configuration set; please create an instance of OSCRuby::Client with configuration settings')
294
-
295
- # end
296
-
297
- # it 'should return multiple instances of OSCRuby::Account', :vcr do
298
-
299
- # answers = OSCRuby::Account.all(client)
300
-
301
- # expect(answers.size).to be > 0
302
-
303
- # # puts "Checking if OSCRuby::Account.all produces multiple instances of answers"
304
-
305
- # answers.each_with_index do |p,i|
306
-
307
- # if i < 10
308
-
309
- # expect(p).to be_an(OSCRuby::Account)
310
-
311
- # # puts p.name
312
-
313
- # end
314
-
315
- # end
316
-
317
- # end
318
-
319
- # it 'should just return JSON if the return_json parameter is set to true', :vcr do
320
-
321
- # expect(OSCRuby::Account.all(client,true)).to be_a(String)
322
-
323
- # end
324
-
325
- # end
326
-
327
- # context '#where' do
328
-
329
- # it 'should expect client is an instance of OSCRuby::Client class and raise an error if does not' do
330
-
331
- # expect(client).to be_an(OSCRuby::Client)
332
-
333
- # client = nil
334
-
335
- # expect{OSCRuby::Account.where(client,'query')}.to raise_error('Client must have some configuration set; please create an instance of OSCRuby::Client with configuration settings')
336
-
337
- # end
338
-
339
- # it 'should raise an error if there is no query' do
340
-
341
- # expect{OSCRuby::Account.where(client)}.to raise_error("A query must be specified when using the 'where' method")
342
-
343
- # end
344
-
345
- # it 'should take a query and return results', :vcr do
346
-
347
- # answers_lvl_1 = OSCRuby::Account.where(client,"language.id = 11")
348
-
349
- # expect(answers_lvl_1.count).to be > 0
350
-
351
- # answers_lvl_1.each_with_index do |p,i|
352
-
353
- # if i < 10
354
-
355
- # expect(p).to be_an(OSCRuby::Account)
356
-
357
- # # puts p.name
358
-
359
- # end
360
-
361
- # end
362
-
363
- # end
364
-
365
- # it 'should raise an error if the query returns 0 results', :vcr do
366
-
367
- # expect{OSCRuby::Account.where(client,"id = 6546546546546")}.to raise_error('There were no objects matching your query; please try again.')
368
-
369
- # end
370
-
371
- # it 'should just return JSON if the return_json parameter is set to true', :vcr do
372
-
373
- # parents = OSCRuby::Account.where(client,"parent is null and lookupname not like 'Unsure'",true)
374
-
375
- # expect(parents).to be_a(String)
376
-
377
- # # puts parents
378
-
379
- # end
380
-
381
- # end
382
-
383
- # context '#update' do
384
-
385
- # it 'should expect client is an instance of OSCRuby::Client class and raise an error if does not', :vcr do
386
-
387
- # known_working_answer = OSCRuby::Account.find(client, 2222)
388
-
389
- # expect(client).to be_an(OSCRuby::Client)
390
-
391
- # client = nil
392
-
393
- # expect{known_working_answer.update(client)}.to raise_error('Client must have some configuration set; please create an instance of OSCRuby::Client with configuration settings')
394
-
395
- # end
396
-
397
- # it 'should expect that the Answer is an instance of a OSCRuby::Account', :vcr do
398
-
399
- # known_working_answer = OSCRuby::Account.find(client, 2222)
400
-
401
- # expect(known_working_answer).to be_an(OSCRuby::Account)
402
-
403
- # end
404
-
405
- # it 'should expect that the answer has an ID and spit out an error if it does not', :vcr do
406
-
407
- # known_working_answer = OSCRuby::Account.find(client, 2222)
408
-
409
- # known_working_answer.id = nil
410
-
411
- # expect{known_working_answer.update(client)}.to raise_error('OSCRuby::Account must have a valid ID set')
412
-
413
- # end
414
-
415
- # # it 'should update name when the names is updated', :vcr do
416
-
417
- # # test_answers = OSCRuby::Account.where(client,"language.id = 11")
418
- # # first_prod = test_answers[0]
419
-
420
- # # first_prod.names[0] = {"labelText" => "TEST-answer-UPDATED", "language" => {"id" => 1}}
421
-
422
- # # first_prod.update(client)
423
-
424
- # # expect(first_prod.name).to eq('TEST-answer-UPDATED')
425
-
426
- # # end
427
-
428
- # it 'should just return JSON if the return_json parameter is set to true', :vcr do
429
-
430
- # known_working_answer = OSCRuby::Account.find(client, 2222)
431
-
432
- # test = known_working_answer.update(client,true)
433
-
434
- # expect(test).to be_a(String)
435
-
436
- # end
437
-
438
- # end
439
-
440
- # context '#destroy' do
441
-
442
- # it 'should expect client is an instance of OSCRuby::Client class and raise an error if does not', :vcr do
443
-
444
- # test_answers = OSCRuby::Account.where(client,"summary like '%Answer summary text%'")
445
- # answer_to_delete = test_answers[0]
446
-
447
- # expect(client).to be_an(OSCRuby::Client)
448
-
449
- # client = nil
450
-
451
- # expect{answer_to_delete.destroy(client)}.to raise_error('Client must have some configuration set; please create an instance of OSCRuby::Client with configuration settings')
452
-
453
- # end
454
-
455
- # it 'should expect that the Service answer is an instance of a OSCRuby::Account', :vcr do
456
-
457
- # test_answers = OSCRuby::Account.where(client,"summary like '%Answer summary text%'")
458
- # answer_to_delete = test_answers[0]
459
-
460
- # expect(answer_to_delete).to be_an(OSCRuby::Account)
461
-
462
- # end
463
-
464
- # it 'should expect that the answer has an ID and spit out an error if it does not', :vcr do
465
-
466
- # test_answers = OSCRuby::Account.where(client,"summary like '%Answer summary text%'")
467
- # answer_to_delete = test_answers[0]
468
-
469
- # answer_to_delete.id = nil
470
-
471
- # expect{answer_to_delete.destroy(client)}.to raise_error('OSCRuby::Account must have a valid ID set')
472
-
473
- # end
474
-
475
- # it 'should delete the answer', :vcr do
476
-
477
- # test_answers = OSCRuby::Account.where(client,"summary like '%Answer summary text%'")
478
-
479
- # answer_to_delete = test_answers[0]
480
-
481
- # id_to_find = answer_to_delete.id
482
-
483
- # test_answers.each do |answer|
484
-
485
- # puts answer.id
486
-
487
- # answer.destroy(client)
488
-
489
- # end
490
-
491
- # expect{OSCRuby::Account.find(client, id_to_find)}.to raise_error('There were no objects matching your query; please try again.')
492
-
493
- # end
494
-
495
- # end
496
-
497
- end