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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTA5OTU4OGMxM2QyNjYzMDNmY2NiNTk4NDQxZjE2MzE2ZjY3NTMxZA==
4
+ NGY5MTQwNzc1NzU0MTk0ZDJiZTEwOGViZTcxNmUxZTkxMzlhYzhlMQ==
5
5
  data.tar.gz: !binary |-
6
- NjgwZjZlYjA4NDBjOTliZjcwZmY4NzIzNTBhZDM2ZGQ5Y2U5ODk0YQ==
6
+ MmNjYzYwMDhlZTZhYTVmMDFhZDIxY2IwZTRmNmZkN2RhZDY5OTkwMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTNiMjMwYmE2YmIxMmQ2YWQwNGE5ZWI0ZjE2ZDYwODBhNTBlNzRkOWU1ODY1
10
- ODUwNzk5MzA0MDBiMjhjZDkwMjBkNzU4NGU0YjMzZjliYmQ0Njg4NWIyMWY0
11
- MDE4NTcxYzY1YTkxY2JhM2IwMGQyYzg2Mzg5NzQ0Mzc4MzNjMjQ=
9
+ ZTVhMGNjMDJkN2M3Yjg2YjMzN2EwYTNmODlmNDYwMzI2NDljOGUxMTk2NjU4
10
+ NjQyZDAwODY4N2M4YmFkNGU3ZDZkMjhhYTFjYzQ5MmI4YTE5MTVlMjM2M2Vl
11
+ MjdlZTY4ZDYzNzIwMzBlNzUxZWI5NDNjNGYxNjFhNTkzYjVmMjY=
12
12
  data.tar.gz: !binary |-
13
- MDg2ZDcyOTUyNmNlMzUwNGYyZmU5YTcwYTlmOTlhZjY3Y2MxYWVjNDllYWY1
14
- NWUxMTExZWM1NGIzNWE2MjkzNmJmNjZhZGQyMmNlYjkxYWFlZTJhNzZjODQ0
15
- YmVjN2Y5NzVhNTg5Y2Y2YjcxZGVjNjJhYzI2NGZjZTMxZjA0MDU=
13
+ NmUwYmNlMjgyMWRmZDFmYjYzNzA2NjdjZGQ5OTAxOTg5MWIyMGNmZTNjMGM1
14
+ MmNmNDJiYTRkODY0YjZhMTg0MzQ2YzU5ZjYwMTMwOGFlMzFhOGU4ZjA0ZTRm
15
+ NjE1NjA0Yzg0ZmEzNTM3MmVlOGE4YzY1Mzg1ZTViN2RkNWM4N2M=
@@ -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/Admin/#{$REGIS_TEST_VALUES['section_uuid']}?format=json")
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.uuid == $REGIS_TEST_VALUES['section_uuid']).to be true
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.uuid).not_to be_empty
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.title).not_to be_empty
26
- expect(@response.section.min_credits).to be > 0
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/Admin/#{$REGIS_TEST_VALUES['section_uuid']}?format=json")
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/Admin/#{uuid}", { :format => 'json' }
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/Admin/#{reporting_term}", { :format => 'json' }
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 :uuid
8
+ attr_reader :secUUID
8
9
  attr_reader :course_name
9
- attr_reader :title
10
- attr_reader :location
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 :min_credits
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
@@ -6,10 +6,8 @@ module Regis
6
6
  class Sections < Base
7
7
  attr_reader :sections
8
8
 
9
- def initialize(json)
10
- super(json)
11
-
12
- @sections = parse(@sections, Model::Section)
9
+ def initialize(json)
10
+ @sections = parse(json, Model::Section)
13
11
  end
14
12
  end
15
13
  end
data/lib/regis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Regis
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Tucker