regis 0.0.4 → 0.0.5
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.
- checksums.yaml +8 -8
- data/features/regis_api.feature +2 -1
- data/features/step_definitions/api_steps.rb +10 -6
- data/lib/regis/endpoint/section.rb +1 -1
- data/lib/regis/endpoint/sections.rb +1 -1
- data/lib/regis/responses/models/section.rb +19 -5
- data/lib/regis/responses/sections.rb +2 -4
- data/lib/regis/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGY5MTQwNzc1NzU0MTk0ZDJiZTEwOGViZTcxNmUxZTkxMzlhYzhlMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmNjYzYwMDhlZTZhYTVmMDFhZDIxY2IwZTRmNmZkN2RhZDY5OTkwMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTVhMGNjMDJkN2M3Yjg2YjMzN2EwYTNmODlmNDYwMzI2NDljOGUxMTk2NjU4
|
10
|
+
NjQyZDAwODY4N2M4YmFkNGU3ZDZkMjhhYTFjYzQ5MmI4YTE5MTVlMjM2M2Vl
|
11
|
+
MjdlZTY4ZDYzNzIwMzBlNzUxZWI5NDNjNGYxNjFhNTkzYjVmMjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmUwYmNlMjgyMWRmZDFmYjYzNzA2NjdjZGQ5OTAxOTg5MWIyMGNmZTNjMGM1
|
14
|
+
MmNmNDJiYTRkODY0YjZhMTg0MzQ2YzU5ZjYwMTMwOGFlMzFhOGU4ZjA0ZTRm
|
15
|
+
NjE1NjA0Yzg0ZmEzNTM3MmVlOGE4YzY1Mzg1ZTViN2RkNWM4N2M=
|
data/features/regis_api.feature
CHANGED
@@ -5,7 +5,7 @@ Feature: regis api can connect
|
|
5
5
|
Scenario: search sections
|
6
6
|
When I search for sections
|
7
7
|
Then I should receive a list of sections
|
8
|
-
|
8
|
+
|
9
9
|
Scenario: retrieve section
|
10
10
|
When I ask for a section
|
11
11
|
Then I should receive the section I asked for
|
@@ -13,6 +13,7 @@ Scenario: retrieve section
|
|
13
13
|
Scenario: section values are populated
|
14
14
|
When I ask for a section
|
15
15
|
Then I should have populated section values
|
16
|
+
Then I should have an instructor
|
16
17
|
|
17
18
|
Scenario: api is cached
|
18
19
|
When I reset the section cache
|
@@ -7,7 +7,7 @@ Then /^I should receive a list of sections$/ do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
When /^I reset the section cache$/ do
|
10
|
-
Regis.client.configuration.cache.delete("/Section
|
10
|
+
Regis.client.configuration.cache.delete("/Section/#{$REGIS_TEST_VALUES['section_uuid']}?format=json")
|
11
11
|
end
|
12
12
|
|
13
13
|
When /^I ask for a section$/ do
|
@@ -15,18 +15,22 @@ When /^I ask for a section$/ do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
Then /^I should receive the section I asked for$/ do
|
18
|
-
expect(@response.section.
|
18
|
+
expect(@response.section.secUUID == $REGIS_TEST_VALUES['section_uuid']).to be true
|
19
19
|
end
|
20
20
|
|
21
21
|
Then /^I should have populated section values$/ do
|
22
|
-
expect(@response.section.
|
22
|
+
expect(@response.section.secUUID).not_to be_empty
|
23
23
|
expect(@response.section.reporting_term).not_to be_empty
|
24
24
|
expect(@response.section.course_name).not_to be_empty
|
25
|
-
expect(@response.section.
|
26
|
-
expect(@response.section.
|
25
|
+
expect(@response.section.course_title).not_to be_empty
|
26
|
+
expect(@response.section.credits_long_name).not_to be_empty
|
27
|
+
end
|
28
|
+
|
29
|
+
Then /^I should have an instructor$/ do
|
30
|
+
expect(@response.section.instructors[0].regent_id).to be > 0
|
27
31
|
end
|
28
32
|
|
29
33
|
Then /^I should have a cached response$/ do
|
30
|
-
response = Regis.client.configuration.cache.read("/Section
|
34
|
+
response = Regis.client.configuration.cache.read("/Section/#{$REGIS_TEST_VALUES['section_uuid']}?format=json")
|
31
35
|
expect(response).to be_instance_of(Faraday::Response)
|
32
36
|
end
|
@@ -9,7 +9,7 @@ module Regis
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def section_get_by_uuid(uuid)
|
12
|
-
response = @client.connection.get "/Section
|
12
|
+
response = @client.connection.get "/Section/#{uuid}", { :format => 'json' }
|
13
13
|
Response::Section.new(response.body)
|
14
14
|
end
|
15
15
|
end
|
@@ -9,7 +9,7 @@ module Regis
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def sections_get_by_reporting_term(reporting_term)
|
12
|
-
response = @client.connection.get "/Sections/
|
12
|
+
response = @client.connection.get "/Sections/Lookup/#{reporting_term}", { :format => 'json' }
|
13
13
|
Response::Sections.new(response.body)
|
14
14
|
end
|
15
15
|
end
|
@@ -1,18 +1,27 @@
|
|
1
1
|
require 'regis/responses/base'
|
2
|
+
require 'regis/responses/models/instructor'
|
2
3
|
|
3
4
|
module Regis
|
4
5
|
module Response
|
5
6
|
module Model
|
6
7
|
class Section < Response::Base
|
7
|
-
attr_reader :
|
8
|
+
attr_reader :secUUID
|
8
9
|
attr_reader :course_name
|
9
|
-
attr_reader :
|
10
|
-
attr_reader :
|
10
|
+
attr_reader :course_description
|
11
|
+
attr_reader :course_title
|
12
|
+
attr_reader :section_code
|
13
|
+
attr_reader :location_code
|
14
|
+
attr_reader :location_long_name
|
11
15
|
attr_reader :room
|
12
16
|
|
13
17
|
attr_reader :is_audio
|
14
18
|
attr_reader :is_oncampus
|
15
19
|
|
20
|
+
attr_reader :prerequisites
|
21
|
+
attr_reader :corequisites
|
22
|
+
|
23
|
+
attr_reader :current_status
|
24
|
+
|
16
25
|
attr_reader :start_date
|
17
26
|
attr_reader :end_date
|
18
27
|
attr_reader :meeting_days
|
@@ -27,12 +36,17 @@ module Regis
|
|
27
36
|
attr_reader :is_unlisted
|
28
37
|
|
29
38
|
attr_reader :reporting_term
|
30
|
-
attr_reader :
|
39
|
+
attr_reader :term
|
40
|
+
attr_reader :credits_long_name
|
31
41
|
attr_reader :max_credits
|
32
42
|
attr_reader :is_pass_fail
|
33
|
-
|
43
|
+
|
44
|
+
attr_reader :instructors
|
45
|
+
|
34
46
|
def initialize(json)
|
35
47
|
super(json)
|
48
|
+
|
49
|
+
@instructors = parse(@instructors, Instructor)
|
36
50
|
end
|
37
51
|
end
|
38
52
|
end
|
data/lib/regis/version.rb
CHANGED