proctorserv-api 1.0.2 → 1.0.3
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.
- data/README.md +58 -25
- data/lib/proctorserv_api.rb +78 -30
- data/spec/proctorserv_api_spec.rb +12 -7
- metadata +11 -5
- checksums.yaml +0 -15
data/README.md
CHANGED
@@ -2,55 +2,86 @@
|
|
2
2
|
|
3
3
|
A ruby wrapper around the Proctorserve scheduling API, which allows a web service to manage various scheduling actions. This gem is framework agnostic -- it will work as part of a Rails or Sinatra project as easily as from a stand-alone script.
|
4
4
|
|
5
|
-
Creating a session through the scheduling API sets up a future or immediate opportunity for
|
5
|
+
Creating a session through the scheduling API sets up a future or immediate opportunity for a user of an integrating system to take their examination in a proctored and recorded environment. Important identifiers (eg. user or test instance) are required so that an integrating web service can request an individual session or a more involved list (like all test sessions for an exam or all test sessions for a specific user/subject) to playback. However, Proctorserve does not serve as a database of record - the integrating system is responsible for housing test taker and test information as well as keeping Proctorserve up to date. Optionally, when creating a reservation, the integrating system can opt to scope that session to a particular client of theirs -- Proctorserve can organize data by customer as well as that customer's clients.
|
6
|
+
|
7
|
+
**Note:** If you do not currently have a ProctorCam account, you will need one to actually use the code contained in this repo. You may create an account by calling 877-TES-T127.
|
6
8
|
|
7
9
|
#### Example workflows
|
8
10
|
|
9
|
-
|
11
|
+
**Scheduling ahead of time (future reservation)**
|
12
|
+
|
13
|
+
- A test taker in the integrating system needs to select a time to take their examination.
|
14
|
+
- The integrating system makes an API request to Proctorserve to get a list of schedulable times
|
15
|
+
- The test taker chooses a schedulable time, triggering an API request to Proctorserve to make a reservation for that user at that time
|
16
|
+
- On test day, the integrating system presents the test taker with the Proctorserve launch session component
|
17
|
+
- The test taker downloads the ProctorApp desktop application and completes their session
|
18
|
+
|
19
|
+
*Required Parameters:*
|
20
|
+
|
21
|
+
- :time (Time) - Time around which to find slots
|
22
|
+
- :customer_subject_id (String) - Unique identifier in API customer's system for the person taking this test
|
23
|
+
- :customer_client_subject_id (String) - Unique identifier in API customer's client's system for the person taking this test
|
24
|
+
- :client_code (String) - Unique identifier for API customer's client
|
25
|
+
- :reservation_id (String) - Unique identifier representing this test instance in API customer's system
|
26
|
+
- :session_duration (int) - length in minutes allotted for this examination
|
27
|
+
- :exam_code (String) - Unique identifier representing the group of tests this specific test instance belongs to
|
28
|
+
|
29
|
+
*Optional Parameters:*
|
30
|
+
|
31
|
+
- :complete_url (String) - URL that the candidate is redirected to after exam completion
|
32
|
+
- :first_name (String) - First name of the candidate taking the exam
|
33
|
+
- :last_name (String) - Last name of the candidate taking the exam
|
10
34
|
|
11
|
-
|
12
|
-
- The integrating system makes an API request to Proctorserve to get a list of scheduable times
|
13
|
-
- The test taker chooses a schedulable time, triggering an API request to Proctorserve to make a reservation for that user at that time
|
14
|
-
- On test day, the integrating system presents the test taker with the Proctorserve launch session component
|
15
|
-
- The tast taker downloads the ProctorApp desktop application and completes their session
|
35
|
+
**Scheduling for now (immediate reservation)**
|
16
36
|
|
17
|
-
|
37
|
+
- A test taker in the integrating system is ready to take their examination
|
38
|
+
- The integrating system makes an API request to Proctorserve to make an immediate reservation
|
39
|
+
- The integrating system presents the test taker with the Proctorserve launch session component
|
40
|
+
- The test taker downloads the ProctorApp desktop application and completes their session
|
18
41
|
|
19
|
-
|
42
|
+
*Required Parameters:*
|
20
43
|
|
21
|
-
|
22
|
-
|
23
|
-
|
44
|
+
- :customer_subject_id (String) - Unique identifier in API customer's system for the person taking this test
|
45
|
+
- :customer_client_subject_id (String) - Unique identifier in API customer's client's system for the person taking this test
|
46
|
+
- :client_code (String) - Unique identifier for API customer's client
|
47
|
+
- :reservation_id (String) - Unique identifier representing this test instance in API customer's system
|
48
|
+
- :session_duration (int) - length in minutes allotted for this examination presents the test taker with the Proctorserve launch session component
|
49
|
+
- :exam_code (String) - Unique identifier representing the group of tests this specific test instance belongs to
|
50
|
+
|
51
|
+
*Optional Parameters:*
|
52
|
+
|
53
|
+
- :complete_url (String) - URL that the candidate is redirected to after exam completion
|
54
|
+
- :first_name (String) - First name of the candidate taking the exam
|
55
|
+
- :last_name (String) - Last name of the candidate taking the exam - The tast taker downloads the ProctorApp desktop application and completes their session
|
24
56
|
|
25
57
|
#### Installation
|
26
58
|
|
27
59
|
$ gem install proctorserv-api
|
28
60
|
|
29
61
|
To use our ruby API in a project
|
30
|
-
|
31
|
-
|
32
|
-
require 'proctorserv_api'
|
62
|
+
```ruby
|
63
|
+
require 'proctorserv_api'
|
33
64
|
```
|
34
65
|
|
35
66
|
#### Configuration
|
36
67
|
|
37
68
|
The constructor takes two required parameters: the customer_identifier and shared_secret
|
38
69
|
|
39
|
-
|
70
|
+
*What's our customer_identifier?*
|
40
71
|
|
41
|
-
|
72
|
+
The Proctorserve service requires that incoming requests identify who is sending them with a `customer_id` parameter. Once a customer account has been set up with Proctorserve, it's customer identifier should be viewable and editable through the web interface.
|
42
73
|
|
43
|
-
|
74
|
+
*What's the shared_secret for?*
|
44
75
|
|
45
|
-
Proctorserve uses a secret key that is shared between customer and service as part of a two-factor authentication scheme. This is also viewable and editable through the web interface. It is important to keep this secure, otherwise a man in the middle can make requests on
|
76
|
+
Proctorserve uses a secret key that is shared between customer and service as part of a two-factor authentication scheme. This is also viewable and editable through the web interface. It is important to keep this secure, otherwise a man in the middle can make requests on the integrating system's behalf.
|
46
77
|
|
47
78
|
#### Usage
|
48
79
|
|
49
80
|
```ruby
|
50
81
|
proctorserv_api = Proctorcam::Proctorserv::ProctorservApi.new("our_customer_identifier", "our_shared_secret")
|
51
82
|
options = {
|
52
|
-
:
|
53
|
-
:
|
83
|
+
:lower_bound => Time.now,
|
84
|
+
:upper_bound => scheduling_window_start + 24 * 60 * 60, # tomorrow at this time
|
54
85
|
:test_length => 60 # minutes
|
55
86
|
}
|
56
87
|
available_timeslots = proctorserv_api.get_available_timeslots_between options
|
@@ -61,13 +92,15 @@ available_timeslots = proctorserv_api.get_available_timeslots_between options
|
|
61
92
|
|
62
93
|
The following methods are supported
|
63
94
|
|
64
|
-
```ruby
|
65
|
-
proctorserv_api = Proctorcam::Proctorserv::ProctorservApi.new("our_customer_identifier", "our_shared_secret")
|
66
|
-
proctorserv_api.get_available_timeslots_between
|
95
|
+
```ruby
|
96
|
+
proctorserv_api = Proctorcam::Proctorserv::ProctorservApi.new("our_customer_identifier", "our_shared_secret")
|
97
|
+
proctorserv_api.get_available_timeslots_between
|
67
98
|
proctorserv_api.get_available_timeslots_around
|
68
99
|
proctorserv_api.make_reservation
|
69
100
|
proctorserv_api.make_immediate_reservation
|
70
101
|
proctorserv_api.cancel_reservation
|
102
|
+
proctorserv_api.generate_jsonp_token
|
103
|
+
proctorserv_api.generate_secure_review_url
|
71
104
|
```
|
72
105
|
|
73
|
-
Further documentation for these methods can be found
|
106
|
+
Further documentation for these methods can be found [here](http://rubydoc.info/github/ProctorCam/proctorserv-api-rb/master/frames)
|
data/lib/proctorserv_api.rb
CHANGED
@@ -29,7 +29,7 @@ module ProctorCam
|
|
29
29
|
module Proctorserv
|
30
30
|
class ProctorservApi
|
31
31
|
|
32
|
-
VERSION = "1.0.
|
32
|
+
VERSION = "1.0.3"
|
33
33
|
|
34
34
|
def initialize(api_identifier, shared_secret, service_protocol = "https", service_url = "service.proctorcam.com")
|
35
35
|
@service_protocol = service_protocol
|
@@ -46,16 +46,17 @@ module ProctorCam
|
|
46
46
|
# This method will raise exceptions related to authentication (InvalidClientException, InvalidSignatureException, InvalidIpException) or not providing required data (MissingRequiredParameterException)
|
47
47
|
#
|
48
48
|
# @param [Hash{Symbol => String}] options
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
49
|
+
# Required:
|
50
|
+
# - :lower_bound (Time or int seconds since epoch) - the earlier of two timestamps to find available timeslots between
|
51
|
+
# - :upper_bound (Time or int seconds since epoch) - the later of two timestamps to find available timeslots between
|
52
|
+
# - :session_duration (int) - is the length in minutes alloted for this examination
|
52
53
|
# @return [Array<Time>] list of Time objects that represent schedulable timeslots in Proctorserve for a test of length session_duration between lower_bound and upper_bound
|
53
54
|
def get_available_timeslots_between(options)
|
54
55
|
requires_of options, [:lower_bound, :upper_bound, :session_duration]
|
55
56
|
url = "#{@service_protocol}://#{@service_url}/#{__method__}"
|
56
57
|
convert_times_to_integer options, :lower_bound, :upper_bound
|
57
58
|
response = RestRequestClient.new.make_get_request url, @api_identifier, @shared_secret, options
|
58
|
-
parsed_response = JSON.parse response
|
59
|
+
parsed_response = JSON.parse response.body
|
59
60
|
raise_exception_if_necessary(parsed_response) if response.code != 200
|
60
61
|
|
61
62
|
parsed_response.map{|timestamp| Time.at(timestamp)}
|
@@ -70,16 +71,17 @@ module ProctorCam
|
|
70
71
|
# This method will raise exceptions related to authentication (InvalidClientException, InvalidSignatureException, InvalidIpException) or not providing required data (MissingRequiredParameterException)
|
71
72
|
#
|
72
73
|
# @param [Hash{Symbol => String}] options
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
74
|
+
# Required:
|
75
|
+
# - :time (Time or int seconds since epoch) - time around which to find slots
|
76
|
+
# - :num_slots (int) - number of slots to return
|
77
|
+
# - :session_duration (int) - length in minutes alloted for this examination
|
76
78
|
# @return [Array<Time>] list (length num_slots or 20) of Time objects that represent schedulable timeslots in Proctorserve for a test of length session_duration around time passed in options hash
|
77
79
|
def get_available_timeslots_around(options)
|
78
80
|
requires_of options, [:time, :num_slots, :session_duration]
|
79
81
|
url = "#{@service_protocol}://#{@service_url}/#{__method__}"
|
80
82
|
convert_times_to_integer options, :time
|
81
83
|
response = RestRequestClient.new.make_get_request url, @api_identifier, @shared_secret, options
|
82
|
-
parsed_response = JSON.parse response
|
84
|
+
parsed_response = JSON.parse response.body
|
83
85
|
raise_exception_if_necessary(parsed_response) if response.code != 200
|
84
86
|
|
85
87
|
parsed_response.map{|timestamp| Time.at(timestamp)}
|
@@ -90,24 +92,29 @@ module ProctorCam
|
|
90
92
|
# This method will raise exceptions related to authentication (InvalidClientException, InvalidSignatureException, InvalidIpException) or not providing required data (MissingRequiredParameterException)
|
91
93
|
#
|
92
94
|
# @param [Hash{Symbol => String}] options
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
95
|
+
# Required:
|
96
|
+
# - :time (Time or int seconds since epoch) - Scheduable time for examination, as obtained by get_available_timeslots_between or get_available_timeslots_around
|
97
|
+
# - :customer_subject_id (String) - Unique identifier in API customer's system for the person taking this test
|
98
|
+
# - :customer_client_subject_id (String) - Unique identifier in API customer's client's system for the person taking this test
|
99
|
+
# - :client_code (String) - Unique identifier for API customer's client
|
100
|
+
# - :reservation_id (String) - Unique identifier representing this test instance in API customer's system
|
101
|
+
# - :session_duration (int) - Session length in minutes
|
102
|
+
# - :exam_code (String) - Unique identifier representing the group of tests this specific test instance belongs to
|
103
|
+
# Optional:
|
104
|
+
# - :complete_url (String) - URL that the candidate is redirected to after exam completion
|
105
|
+
# - :first_name (String) - First name of the candidate taking the exam
|
106
|
+
# - :last_name (String) - Last name of the candidate taking the exam
|
107
|
+
# @return [int] session_id - the Proctorserve id for the created session. Will return -1 if the time passed is not scheduable.
|
101
108
|
def make_reservation(options)
|
102
109
|
requires_of options, [:time, :customer_subject_id, :customer_client_subject_id, :client_code, :reservation_id, :session_duration, :exam_code]
|
103
110
|
url = "#{@service_protocol}://#{@service_url}/#{__method__}"
|
104
111
|
convert_times_to_integer options, :time
|
105
112
|
response = RestRequestClient.new.make_post_request url, @api_identifier, @shared_secret, options
|
106
113
|
|
107
|
-
parsed_response = JSON.parse response
|
114
|
+
parsed_response = JSON.parse response.body
|
108
115
|
raise_exception_if_necessary(parsed_response) if response.code != 200
|
109
116
|
|
110
|
-
return
|
117
|
+
return -1 if response.code == 404
|
111
118
|
|
112
119
|
parsed_response["session_id"]
|
113
120
|
end
|
@@ -117,23 +124,28 @@ module ProctorCam
|
|
117
124
|
# This method will raise exceptions related to authentication (InvalidClientException, InvalidSignatureException, InvalidIpException) or not providing required data (MissingRequiredParameterException)
|
118
125
|
#
|
119
126
|
# @param [Hash{Symbol => String}] options
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
#
|
127
|
+
# Required:
|
128
|
+
# - :customer_subject_id (String) - Unique identifier in API customer's system for the person taking this test
|
129
|
+
# - :customer_client_subject_id (String) - Unique identifier in API customer's client's system for the person taking this test
|
130
|
+
# - :client_code (String) - Unique identifier for API customer's client
|
131
|
+
# - :reservation_id (String) - Unique identifier representing this test instance in API customer's system
|
132
|
+
# - :session_duration (int) - Session length in minutes
|
133
|
+
# - :exam_code (String) - Unique identifier representing the group of tests this specific test instance belongs to
|
134
|
+
# Optional:
|
135
|
+
# - :complete_url (String) - URL that the candidate is redirected to after exam completion
|
136
|
+
# - :first_name (String) - First name of the candidate taking the exam
|
137
|
+
# - :last_name (String) - Last name of the candidate taking the exam
|
138
|
+
# @return [int] session_id - the Proctorserve id for the created session. Will return -1 if the time passed is not scheduable.
|
127
139
|
def make_immediate_reservation(options)
|
128
140
|
requires_of options, [:customer_subject_id, :customer_client_subject_id, :client_code, :reservation_id, :session_duration, :exam_code]
|
129
141
|
url = "#{@service_protocol}://#{@service_url}/#{__method__}"
|
130
142
|
convert_times_to_integer options, :time
|
131
143
|
response = RestRequestClient.new.make_post_request url, @api_identifier, @shared_secret, options
|
132
144
|
|
133
|
-
parsed_response = JSON.parse response
|
145
|
+
parsed_response = JSON.parse response.body
|
134
146
|
raise_exception_if_necessary(parsed_response) if response.code != 200
|
135
147
|
|
136
|
-
return
|
148
|
+
return -1 if response.code == 404
|
137
149
|
|
138
150
|
parsed_response["session_id"]
|
139
151
|
end
|
@@ -142,7 +154,9 @@ module ProctorCam
|
|
142
154
|
#
|
143
155
|
# This method will raise exceptions related to authentication (InvalidClientException, InvalidSignatureException, InvalidIpException) or not providing required data (MissingRequiredParameterException)
|
144
156
|
#
|
145
|
-
# @param [
|
157
|
+
# @param [Hash{Symbol => String}] options
|
158
|
+
# Required:
|
159
|
+
# - :session_id (int) Proctorserve id for the session to be canceled
|
146
160
|
# @return [Boolean] whether or not the test was successfully canceled.
|
147
161
|
def cancel_reservation(options)
|
148
162
|
requires_of options, [:session_id]
|
@@ -152,13 +166,47 @@ module ProctorCam
|
|
152
166
|
return true if response.code == 204
|
153
167
|
|
154
168
|
if response.code != 200
|
155
|
-
parsed_response = JSON.parse response
|
169
|
+
parsed_response = JSON.parse response.body
|
156
170
|
raise_exception_if_necessary(parsed_response)
|
157
171
|
end
|
158
172
|
|
159
173
|
false
|
160
174
|
end
|
161
175
|
|
176
|
+
# Generate a secure token that can be used to grant temporary jsonp access to a session for a web browser user to take a session.
|
177
|
+
#
|
178
|
+
# @param [Hash{Symbol => String}] options
|
179
|
+
# - :session_id (int) Proctorserve id for the session to grant access to
|
180
|
+
# - :duration (int) Number of minutes to grant access for (defaults to 1 hour, maximum 3 hours)
|
181
|
+
def generate_jsonp_token(options)
|
182
|
+
requires_of options, [:session_id]
|
183
|
+
|
184
|
+
options[:time] = Time.now.to_i
|
185
|
+
options[:duration] ||= 60
|
186
|
+
options[:duration] = 180 if options[:duration] > 180
|
187
|
+
|
188
|
+
HashedAuthenticator.apply_reverse_guid_and_sign(options, @api_identifier, @shared_secret)
|
189
|
+
options.map{|k,v| "#{k}%3D#{v}"}.join '%26'
|
190
|
+
end
|
191
|
+
|
192
|
+
# Generate a secure token that can be used to grant temporary access to a session for a web browser user to review a session.
|
193
|
+
# Can be loaded an iframe or a new window to grant secure access to a single user for a specified period of time
|
194
|
+
#
|
195
|
+
# @param [Hash{Symbol => String}] options
|
196
|
+
# - :session_id (int) Proctorserve id for the session to grant review access to
|
197
|
+
# - :proctor_id (String) unique identifier representing the user to grant access to. This will determine the user's display name in Proctorserve interfaces.
|
198
|
+
# - :duration (int) Number of minutes link stays active for (defaults to 5 minutes)
|
199
|
+
def generate_secure_review_url(options)
|
200
|
+
requires_of options, [:proctor_id, :session_id]
|
201
|
+
|
202
|
+
options[:time] = Time.now.to_i
|
203
|
+
options[:duration] ||= 5
|
204
|
+
options[:duration] = 180 if options[:duration] > 180
|
205
|
+
|
206
|
+
HashedAuthenticator.apply_reverse_guid_and_sign(options, @api_identifier, @shared_secret)
|
207
|
+
"#{@service_protocol}://#{@service_url}/review?secure_token=#{options.map{|k,v| "#{k}%3D#{v}"}.join '%26'}#watch/#{options[:session_id]}"
|
208
|
+
end
|
209
|
+
|
162
210
|
protected
|
163
211
|
|
164
212
|
def raise_exception_if_necessary(response)
|
@@ -77,20 +77,20 @@ describe ProctorCam::Proctorserv::ProctorservApi do
|
|
77
77
|
describe "make_reservation" do
|
78
78
|
|
79
79
|
it "raises missing_required_parameter_exception when not passed [:time, :customer_subject_id, :customer_client_subject_id, :client_code, :reservation_id, :session_duration, :exam_code] in options hash" do
|
80
|
-
options = {:time => Time.now.to_i, :customer_subject_id => 'c_sub_1', :customer_client_subject_id => 'c_c_sub_1', :client_code => 'c_code', :reservation_id => 'res_id', :session_duration => 60, :
|
80
|
+
options = {:time => Time.now.to_i, :customer_subject_id => 'c_sub_1', :customer_client_subject_id => 'c_c_sub_1', :client_code => 'c_code', :reservation_id => 'res_id', :session_duration => 60, :first_name => 'Ryan', :last_name => 'Callahan', :complete_url => 'http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=71756'}
|
81
81
|
options.each do |k,v|
|
82
82
|
expect{@proctorserv_api.make_reservation options.reject{|key,v| key == k} }.to raise_error ProctorCam::Proctorserv::MissingRequiredParameterException
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
it "returns
|
87
|
-
options = {:time => Time.new(1970, 1, 1,
|
86
|
+
it "returns -1 when time provided is not schedulable" do
|
87
|
+
options = {:time => Time.new(1970, 1, 1, 0, 0, 0), :customer_subject_id => 'c_sub_1', :customer_client_subject_id => 'c_c_sub_1', :client_code => 'c_code', :reservation_id => 'res_id', :session_duration => 60, :exam_code => 'e-code-15a', :first_name => 'Ryan', :last_name => 'Callahan', :complete_url => 'http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=71756'}
|
88
88
|
response = @proctorserv_api.make_reservation options
|
89
|
-
response.should ==
|
89
|
+
response.should == -1
|
90
90
|
end
|
91
91
|
|
92
92
|
it "returns an int value representing session_id when provided a schedulable time and all required parameters" do
|
93
|
-
options = {:time => Time.now.to_i, :customer_subject_id => 'c_sub_1', :customer_client_subject_id => 'c_c_sub_1', :client_code => 'c_code', :reservation_id => 'res_id', :session_duration => 60, :exam_code => 'e-code-15a'}
|
93
|
+
options = {:time => Time.now.to_i, :customer_subject_id => 'c_sub_1', :customer_client_subject_id => 'c_c_sub_1', :client_code => 'c_code', :reservation_id => 'res_id', :session_duration => 60, :exam_code => 'e-code-15a', :first_name => 'Ryan', :last_name => 'Callahan', :complete_url => 'http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=71756'}
|
94
94
|
response = @proctorserv_api.make_reservation options
|
95
95
|
response.class.should == Fixnum
|
96
96
|
end
|
@@ -100,14 +100,14 @@ describe ProctorCam::Proctorserv::ProctorservApi do
|
|
100
100
|
describe "make_immediate_reservation" do
|
101
101
|
|
102
102
|
it "raises missing_required_parameter_exception when not passed [:customer_subject_id, :customer_client_subject_id, :client_code, :reservation_id, :session_duration, :exam_code] in options hash" do
|
103
|
-
options = {:customer_subject_id => 'c_sub_1', :customer_client_subject_id => 'c_c_sub_1', :client_code => 'c_code', :reservation_id => 'res_id', :session_duration => 60, :
|
103
|
+
options = {:customer_subject_id => 'c_sub_1', :customer_client_subject_id => 'c_c_sub_1', :client_code => 'c_code', :reservation_id => 'res_id', :session_duration => 60, :first_name => 'Ryan', :last_name => 'Callahan', :complete_url => 'http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=71756'}
|
104
104
|
options.each do |k,v|
|
105
105
|
expect{@proctorserv_api.make_immediate_reservation options.reject{|key,v| key == k} }.to raise_error ProctorCam::Proctorserv::MissingRequiredParameterException
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
109
|
it "returns an int value representing session_id when now is a schedulable time and all required parameters" do
|
110
|
-
options = {:customer_subject_id => 'c_sub_1', :customer_client_subject_id => 'c_c_sub_1', :client_code => 'c_code', :reservation_id => 'res_id', :session_duration => 60, :exam_code => 'e-code-15a'}
|
110
|
+
options = {:customer_subject_id => 'c_sub_1', :customer_client_subject_id => 'c_c_sub_1', :client_code => 'c_code', :reservation_id => 'res_id', :session_duration => 60, :exam_code => 'e-code-15a', :first_name => 'Ryan', :last_name => 'Callahan', :complete_url => 'http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=71756'}
|
111
111
|
response = @proctorserv_api.make_immediate_reservation options
|
112
112
|
response.class.should == Fixnum
|
113
113
|
end
|
@@ -134,6 +134,11 @@ describe ProctorCam::Proctorserv::ProctorservApi do
|
|
134
134
|
response.should == false
|
135
135
|
end
|
136
136
|
|
137
|
+
it "returns false when passed a session_id that doesn't correspond with a session id in the system" do
|
138
|
+
response = @proctorserv_api.cancel_reservation({:session_id => "a"})
|
139
|
+
response.should == false
|
140
|
+
end
|
141
|
+
|
137
142
|
end
|
138
143
|
|
139
144
|
end
|
metadata
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proctorserv-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Max Lahey
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-
|
12
|
+
date: 2013-07-15 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rest-client
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -27,6 +30,7 @@ dependencies:
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: rspec
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
35
|
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -58,26 +63,27 @@ files:
|
|
58
63
|
- spec/proctorserv_api_spec.rb
|
59
64
|
homepage: http://github.com/proctorcam/proctorserv-api
|
60
65
|
licenses: []
|
61
|
-
metadata: {}
|
62
66
|
post_install_message:
|
63
67
|
rdoc_options: []
|
64
68
|
require_paths:
|
65
69
|
- lib
|
66
70
|
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
67
72
|
requirements:
|
68
73
|
- - ! '>='
|
69
74
|
- !ruby/object:Gem::Version
|
70
75
|
version: '0'
|
71
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
72
78
|
requirements:
|
73
79
|
- - ! '>='
|
74
80
|
- !ruby/object:Gem::Version
|
75
81
|
version: '0'
|
76
82
|
requirements: []
|
77
83
|
rubyforge_project:
|
78
|
-
rubygems_version:
|
84
|
+
rubygems_version: 1.8.25
|
79
85
|
signing_key:
|
80
|
-
specification_version:
|
86
|
+
specification_version: 3
|
81
87
|
summary: A ruby wrapper around the Proctorserve scheduling API.
|
82
88
|
test_files:
|
83
89
|
- spec/proctorserv_api_spec.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
YWVlNTMxNGQyMWMzYWQzMjM3YTAwODQ2NmM0NDNlZjRlNWUxM2Y3Yg==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MDVkYjVhNDI3ZTAxNDVhNjNiN2NlZTBiMTkwMWE5NGE2ZGFkMWIyOA==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MWMzNjU3NmU0MjZlMDBjYTg5Y2U3NjljZTZjNzZiMzFkYTk4MDZhOTlmMzBj
|
10
|
-
ODg2NDJhNjhkMGVlNTExNTcyNTI2MmRiMDliODQ1NmI1MzZmYWIyNjY0ZTQx
|
11
|
-
Yzc4NTVlMjRiOWVkZTQxMjE5YTZkMDhiOWRmODkwMzUyZWEwMDQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
Zjg3ZDM3MmM3ZWQ4ZTI3YWM5OGYwYmVjZWU2ZDc2MjY3NGNlZjc4MmMwMmZk
|
14
|
-
N2ViZjgyMDFiN2E3NzE5NTExYTc2NmFhMjJlNjRhYTU2ZjQ0ZmI1N2M2ODdk
|
15
|
-
MGRiMTE3ZWI2YzgwMmI3OThiMGQ0MTMwN2Y5YTRjNjZmMTQxMWM=
|