clever-ruby 0.6.2 → 0.7.0
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/CHANGELOG.md +5 -0
 - data/lib/clever-ruby.rb +3 -0
 - data/lib/clever-ruby/api_operations/nested_list.rb +46 -0
 - data/lib/clever-ruby/api_resource.rb +67 -27
 - data/lib/clever-ruby/clever_object.rb +8 -2
 - data/lib/clever-ruby/district.rb +25 -11
 - data/lib/clever-ruby/event.rb +1 -1
 - data/lib/clever-ruby/nested_resource.rb +40 -0
 - data/lib/clever-ruby/school.rb +1 -1
 - data/lib/clever-ruby/section.rb +1 -1
 - data/lib/clever-ruby/student.rb +13 -1
 - data/lib/clever-ruby/teacher.rb +1 -1
 - data/lib/clever-ruby/util.rb +16 -17
 - data/lib/clever-ruby/version.rb +1 -1
 - data/test/data/vcr_cassettes/district_count.yml +6 -6
 - data/test/data/vcr_cassettes/{districts_events.yml → district_events.yml} +29 -164
 - data/test/data/vcr_cassettes/district_find_by_page.yml +12 -12
 - data/test/data/vcr_cassettes/district_find_multiple.yml +12 -12
 - data/test/data/vcr_cassettes/district_find_one.yml +12 -12
 - data/test/data/vcr_cassettes/{districts_schools.yml → district_schools.yml} +25 -148
 - data/test/data/vcr_cassettes/district_sections.yml +2289 -0
 - data/test/data/vcr_cassettes/district_students.yml +2339 -0
 - data/test/data/vcr_cassettes/{districts_teachers.yml → district_teachers.yml} +25 -148
 - data/test/data/vcr_cassettes/districts.yml +12 -12
 - data/test/data/vcr_cassettes/districts_event_pages.yml +76 -469
 - data/test/data/vcr_cassettes/districts_school_pages.yml +31 -154
 - data/test/data/vcr_cassettes/districts_section_pages.yml +284 -407
 - data/test/data/vcr_cassettes/districts_student_pages.yml +165 -288
 - data/test/data/vcr_cassettes/districts_teacher_pages.yml +81 -204
 - data/test/data/vcr_cassettes/error_handling.yml +17 -58
 - data/test/data/vcr_cassettes/event_count.yml +7 -7
 - data/test/data/vcr_cassettes/event_find_by_page.yml +16 -22
 - data/test/data/vcr_cassettes/event_find_multiple.yml +19 -28
 - data/test/data/vcr_cassettes/event_find_one.yml +16 -22
 - data/test/data/vcr_cassettes/events.yml +16 -22
 - data/test/data/vcr_cassettes/school_count.yml +6 -6
 - data/test/data/vcr_cassettes/school_district.yml +140 -0
 - data/test/data/vcr_cassettes/school_events.yml +181 -0
 - data/test/data/vcr_cassettes/school_find_by_page.yml +13 -13
 - data/test/data/vcr_cassettes/school_find_multiple.yml +14 -14
 - data/test/data/vcr_cassettes/school_find_one.yml +13 -13
 - data/test/data/vcr_cassettes/school_sections.yml +1119 -0
 - data/test/data/vcr_cassettes/school_students.yml +1033 -0
 - data/test/data/vcr_cassettes/school_teachers.yml +257 -0
 - data/test/data/vcr_cassettes/schools.yml +13 -13
 - data/test/data/vcr_cassettes/schools_optional_attributes.yml +7 -7
 - data/test/data/vcr_cassettes/section_count.yml +6 -6
 - data/test/data/vcr_cassettes/section_district.yml +393 -0
 - data/test/data/vcr_cassettes/section_events.yml +434 -0
 - data/test/data/vcr_cassettes/section_find_by_page.yml +34 -34
 - data/test/data/vcr_cassettes/section_find_multiple.yml +14 -14
 - data/test/data/vcr_cassettes/section_find_one.yml +14 -14
 - data/test/data/vcr_cassettes/section_school.yml +396 -0
 - data/test/data/vcr_cassettes/section_students.yml +456 -0
 - data/test/data/vcr_cassettes/section_teacher.yml +394 -0
 - data/test/data/vcr_cassettes/sections.yml +34 -34
 - data/test/data/vcr_cassettes/student_count.yml +6 -6
 - data/test/data/vcr_cassettes/student_district.yml +202 -0
 - data/test/data/vcr_cassettes/student_events.yml +243 -0
 - data/test/data/vcr_cassettes/student_find_by_page.yml +83 -83
 - data/test/data/vcr_cassettes/student_find_multiple.yml +14 -14
 - data/test/data/vcr_cassettes/student_find_one.yml +14 -14
 - data/test/data/vcr_cassettes/student_school.yml +205 -0
 - data/test/data/vcr_cassettes/student_sections.yml +269 -0
 - data/test/data/vcr_cassettes/student_teacher.yml +161 -0
 - data/test/data/vcr_cassettes/student_teachers.yml +245 -0
 - data/test/data/vcr_cassettes/students.yml +83 -83
 - data/test/data/vcr_cassettes/teacher_count.yml +6 -6
 - data/test/data/vcr_cassettes/teacher_district.yml +218 -0
 - data/test/data/vcr_cassettes/teacher_events.yml +259 -0
 - data/test/data/vcr_cassettes/teacher_find_by_page.yml +13 -13
 - data/test/data/vcr_cassettes/teacher_find_multiple.yml +14 -14
 - data/test/data/vcr_cassettes/teacher_find_one.yml +13 -13
 - data/test/data/vcr_cassettes/teacher_school.yml +221 -0
 - data/test/data/vcr_cassettes/teacher_sections.yml +291 -0
 - data/test/data/vcr_cassettes/teacher_students.yml +293 -0
 - data/test/data/vcr_cassettes/teachers.yml +13 -13
 - data/test/integration/api_operations/list_test.rb +1 -1
 - data/test/integration/district_test.rb +17 -49
 - data/test/integration/error_handling_test.rb +1 -1
 - data/test/integration/nested_resource_test.rb +27 -0
 - data/test/unit/api_resource_test.rb +32 -0
 - data/test/unit/optional_attributes_test.rb +7 -13
 - metadata +60 -14
 - data/test/data/vcr_cassettes/districts_sections.yml +0 -818
 - data/test/data/vcr_cassettes/districts_students.yml +0 -436
 - data/test/data/vcr_cassettes/districts_students_filtered.yml +0 -170
 
| 
         @@ -8,7 +8,7 @@ http_interactions: 
     | 
|
| 
       8 
8 
     | 
    
         
             
                  string: ''
         
     | 
| 
       9 
9 
     | 
    
         
             
                headers:
         
     | 
| 
       10 
10 
     | 
    
         
             
                  Accept:
         
     | 
| 
       11 
     | 
    
         
            -
                  -  
     | 
| 
      
 11 
     | 
    
         
            +
                  - ! '*/*; q=0.5, application/xml'
         
     | 
| 
       12 
12 
     | 
    
         
             
                  Accept-Encoding:
         
     | 
| 
       13 
13 
     | 
    
         
             
                  - gzip, deflate
         
     | 
| 
       14 
14 
     | 
    
         
             
                  User-Agent:
         
     | 
| 
         @@ -23,13 +23,13 @@ http_interactions: 
     | 
|
| 
       23 
23 
     | 
    
         
             
                  Access-Control-Allow-Methods:
         
     | 
| 
       24 
24 
     | 
    
         
             
                  - GET,PATCH,POST,DELETE
         
     | 
| 
       25 
25 
     | 
    
         
             
                  Access-Control-Allow-Origin:
         
     | 
| 
       26 
     | 
    
         
            -
                  -  
     | 
| 
      
 26 
     | 
    
         
            +
                  - ! '*'
         
     | 
| 
       27 
27 
     | 
    
         
             
                  Content-Type:
         
     | 
| 
       28 
28 
     | 
    
         
             
                  - application/json; charset=utf-8
         
     | 
| 
       29 
29 
     | 
    
         
             
                  Date:
         
     | 
| 
       30 
     | 
    
         
            -
                  -  
     | 
| 
      
 30 
     | 
    
         
            +
                  - Fri, 12 Sep 2014 20:48:34 GMT
         
     | 
| 
       31 
31 
     | 
    
         
             
                  Etag:
         
     | 
| 
       32 
     | 
    
         
            -
                  - '"-409931571"'
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - ! '"-409931571"'
         
     | 
| 
       33 
33 
     | 
    
         
             
                  Server:
         
     | 
| 
       34 
34 
     | 
    
         
             
                  - nginx/1.4.7
         
     | 
| 
       35 
35 
     | 
    
         
             
                  X-Powered-By:
         
     | 
| 
         @@ -39,8 +39,8 @@ http_interactions: 
     | 
|
| 
       39 
39 
     | 
    
         
             
                  Connection:
         
     | 
| 
       40 
40 
     | 
    
         
             
                  - keep-alive
         
     | 
| 
       41 
41 
     | 
    
         
             
                body:
         
     | 
| 
       42 
     | 
    
         
            -
                  encoding:  
     | 
| 
       43 
     | 
    
         
            -
                  string: '{"data":[{"data":{"created":"2012-11-11T15:00:14.036Z","credentials":{"district_password":"Acoev0oow4","district_username":"spinka_leo"},"district":"4fd43cc56d11340000000005","email":"spinka.leo@example.net","last_modified":"2014-02-26T21:15:01.038Z","name":{"first":"Leo","last":"Spinka","middle":"R"},"school":"530e595026403103360ff9fe","sis_id":"11","teacher_number":"539224","title":"Grade
         
     | 
| 
      
 42 
     | 
    
         
            +
                  encoding: US-ASCII
         
     | 
| 
      
 43 
     | 
    
         
            +
                  string: ! '{"data":[{"data":{"created":"2012-11-11T15:00:14.036Z","credentials":{"district_password":"Acoev0oow4","district_username":"spinka_leo"},"district":"4fd43cc56d11340000000005","email":"spinka.leo@example.net","last_modified":"2014-02-26T21:15:01.038Z","name":{"first":"Leo","last":"Spinka","middle":"R"},"school":"530e595026403103360ff9fe","sis_id":"11","teacher_number":"539224","title":"Grade
         
     | 
| 
       44 
44 
     | 
    
         
             
                    3 Common Branch Teacher","id":"509fbd7ec474fab64a8e9d53"},"uri":"/v1.1/teachers/509fbd7ec474fab64a8e9d53"},{"data":{"created":"2012-11-27T15:04:48.474Z","credentials":{"district_password":"OMeitoo3v","district_username":"reuben.conn"},"district":"4fd43cc56d11340000000005","email":"conn_reuben@example.net","last_modified":"2014-02-26T21:15:01.234Z","name":{"first":"Reuben","last":"Conn","middle":"K"},"school":"530e595026403103360ff9ff","sis_id":"33","teacher_number":"215041","title":"Grade
         
     | 
| 
       45 
45 
     | 
    
         
             
                    8 Mathematics Teacher","id":"50b4d690ad221ab95f1c6c39"},"uri":"/v1.1/teachers/50b4d690ad221ab95f1c6c39"},{"data":{"created":"2012-12-01T15:02:36.961Z","credentials":{"district_password":"ru3o8rusbf","district_username":"steven.ogden"},"district":"4fd43cc56d11340000000005","email":"ogden_steven@example.net","last_modified":"2014-02-26T21:15:01.485Z","name":{"first":"Steven","last":"Ogden","middle":"Q"},"school":"530e595026403103360ff9fd","sis_id":"81","teacher_number":"474958","title":"High
         
     | 
| 
       46 
46 
     | 
    
         
             
                    School Science Teacher","id":"50ba1c0c4eda5d94372227eb"},"uri":"/v1.1/teachers/50ba1c0c4eda5d94372227eb"},{"data":{"created":"2012-12-05T15:00:02.670Z","credentials":{"district_password":"Coo0ooyahgh","district_username":"hauck.haylie"},"district":"4fd43cc56d11340000000005","email":"hauck.haylie@example.com","last_modified":"2014-02-26T21:15:01.358Z","name":{"first":"Haylie","last":"Hauck","middle":"J"},"school":"530e595026403103360ff9fd","sis_id":"48","teacher_number":"830340","title":"Grade
         
     | 
| 
         @@ -131,7 +131,7 @@ http_interactions: 
     | 
|
| 
       131 
131 
     | 
    
         
             
                    Coach","id":"530e5955d50c310f36112c18"},"uri":"/v1.1/teachers/530e5955d50c310f36112c18"},{"data":{"created":"2014-02-26T21:15:01.572Z","credentials":{"district_username":"m_paucek","district_password":"jhga8salgh"},"district":"4fd43cc56d11340000000005","email":"paucek_m@example.org","last_modified":"2014-02-26T21:15:01.574Z","name":{"first":"Meaghan","middle":"P","last":"Paucek"},"school":"530e595026403103360ff9fd","sis_id":"93","teacher_number":"843713","title":"High
         
     | 
| 
       132 
132 
     | 
    
         
             
                    School Drama Teacher","id":"530e5955d50c310f36112c19"},"uri":"/v1.1/teachers/530e5955d50c310f36112c19"}],"paging":{"current":1,"total":1,"count":89},"links":[{"rel":"self","uri":"/v1.1/teachers"}]}'
         
     | 
| 
       133 
133 
     | 
    
         
             
                http_version: 
         
     | 
| 
       134 
     | 
    
         
            -
              recorded_at:  
     | 
| 
      
 134 
     | 
    
         
            +
              recorded_at: Fri, 12 Sep 2014 20:48:34 GMT
         
     | 
| 
       135 
135 
     | 
    
         
             
            - request:
         
     | 
| 
       136 
136 
     | 
    
         
             
                method: get
         
     | 
| 
       137 
137 
     | 
    
         
             
                uri: https://DEMO_KEY:@api.clever.com/v1.1/teachers?count=true
         
     | 
| 
         @@ -140,7 +140,7 @@ http_interactions: 
     | 
|
| 
       140 
140 
     | 
    
         
             
                  string: ''
         
     | 
| 
       141 
141 
     | 
    
         
             
                headers:
         
     | 
| 
       142 
142 
     | 
    
         
             
                  Accept:
         
     | 
| 
       143 
     | 
    
         
            -
                  -  
     | 
| 
      
 143 
     | 
    
         
            +
                  - ! '*/*; q=0.5, application/xml'
         
     | 
| 
       144 
144 
     | 
    
         
             
                  Accept-Encoding:
         
     | 
| 
       145 
145 
     | 
    
         
             
                  - gzip, deflate
         
     | 
| 
       146 
146 
     | 
    
         
             
                  User-Agent:
         
     | 
| 
         @@ -155,11 +155,11 @@ http_interactions: 
     | 
|
| 
       155 
155 
     | 
    
         
             
                  Access-Control-Allow-Methods:
         
     | 
| 
       156 
156 
     | 
    
         
             
                  - GET,PATCH,POST,DELETE
         
     | 
| 
       157 
157 
     | 
    
         
             
                  Access-Control-Allow-Origin:
         
     | 
| 
       158 
     | 
    
         
            -
                  -  
     | 
| 
      
 158 
     | 
    
         
            +
                  - ! '*'
         
     | 
| 
       159 
159 
     | 
    
         
             
                  Content-Type:
         
     | 
| 
       160 
160 
     | 
    
         
             
                  - application/json; charset=utf-8
         
     | 
| 
       161 
161 
     | 
    
         
             
                  Date:
         
     | 
| 
       162 
     | 
    
         
            -
                  -  
     | 
| 
      
 162 
     | 
    
         
            +
                  - Fri, 12 Sep 2014 20:48:34 GMT
         
     | 
| 
       163 
163 
     | 
    
         
             
                  Server:
         
     | 
| 
       164 
164 
     | 
    
         
             
                  - nginx/1.4.7
         
     | 
| 
       165 
165 
     | 
    
         
             
                  X-Powered-By:
         
     | 
| 
         @@ -169,8 +169,8 @@ http_interactions: 
     | 
|
| 
       169 
169 
     | 
    
         
             
                  Connection:
         
     | 
| 
       170 
170 
     | 
    
         
             
                  - keep-alive
         
     | 
| 
       171 
171 
     | 
    
         
             
                body:
         
     | 
| 
       172 
     | 
    
         
            -
                  encoding:  
     | 
| 
       173 
     | 
    
         
            -
                  string: '{"count":89,"links":[{"rel":"self","uri":"/v1.1/teachers?count=true"}]}'
         
     | 
| 
      
 172 
     | 
    
         
            +
                  encoding: US-ASCII
         
     | 
| 
      
 173 
     | 
    
         
            +
                  string: ! '{"count":89,"links":[{"rel":"self","uri":"/v1.1/teachers?count=true"}]}'
         
     | 
| 
       174 
174 
     | 
    
         
             
                http_version: 
         
     | 
| 
       175 
     | 
    
         
            -
              recorded_at:  
     | 
| 
      
 175 
     | 
    
         
            +
              recorded_at: Fri, 12 Sep 2014 20:48:34 GMT
         
     | 
| 
       176 
176 
     | 
    
         
             
            recorded_with: VCR 2.4.0
         
     | 
| 
         @@ -28,7 +28,7 @@ describe Clever::APIOperations::List do 
     | 
|
| 
       28 
28 
     | 
    
         
             
              end
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
              [[Clever::District, 1], [Clever::School, 3], [Clever::Teacher, 89],
         
     | 
| 
       31 
     | 
    
         
            -
               [Clever::Student, 1004], [Clever::Section, 379], [Clever::Event,  
     | 
| 
      
 31 
     | 
    
         
            +
               [Clever::Student, 1004], [Clever::Section, 379], [Clever::Event, 7]].each do |test_data|
         
     | 
| 
       32 
32 
     | 
    
         
             
                resource, expected = test_data
         
     | 
| 
       33 
33 
     | 
    
         
             
                name = resource_name resource
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
         @@ -3,14 +3,6 @@ require 'test_helper' 
     | 
|
| 
       3 
3 
     | 
    
         
             
            module Minitest
         
     | 
| 
       4 
4 
     | 
    
         
             
              # Add assertions to Minitest
         
     | 
| 
       5 
5 
     | 
    
         
             
              module Assertions
         
     | 
| 
       6 
     | 
    
         
            -
                def assert_valid_object_list(plural_object_name, object_count, instance_name)
         
     | 
| 
       7 
     | 
    
         
            -
                  VCR.use_cassette("districts_#{plural_object_name}", allow_playback_repeats: true) do
         
     | 
| 
       8 
     | 
    
         
            -
                    district = Clever::District.all.first
         
     | 
| 
       9 
     | 
    
         
            -
                    district.send(plural_object_name).size.must_equal object_count
         
     | 
| 
       10 
     | 
    
         
            -
                    district.send(plural_object_name).first.must_be_instance_of instance_name
         
     | 
| 
       11 
     | 
    
         
            -
                  end
         
     | 
| 
       12 
     | 
    
         
            -
                end
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
6 
     | 
    
         
             
                def assert_valid_object_pages(object_name, limit, page_count)
         
     | 
| 
       15 
7 
     | 
    
         
             
                  VCR.use_cassette("districts_#{object_name}_pages", allow_playback_repeats: true) do
         
     | 
| 
       16 
8 
     | 
    
         
             
                    district = Clever::District.all.first
         
     | 
| 
         @@ -34,54 +26,30 @@ end 
     | 
|
| 
       34 
26 
     | 
    
         
             
            describe Clever::District do
         
     | 
| 
       35 
27 
     | 
    
         
             
              before do
         
     | 
| 
       36 
28 
     | 
    
         
             
                Clever.configure do |config|
         
     | 
| 
       37 
     | 
    
         
            -
                  config. 
     | 
| 
      
 29 
     | 
    
         
            +
                  config.token = 'DEMO_TOKEN'
         
     | 
| 
       38 
30 
     | 
    
         
             
                end
         
     | 
| 
       39 
31 
     | 
    
         
             
              end
         
     | 
| 
       40 
32 
     | 
    
         | 
| 
       41 
     | 
    
         
            -
               
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
              it "retrieves a district's teachers" do
         
     | 
| 
       46 
     | 
    
         
            -
                assert_valid_object_list 'teachers', 89, Clever::Teacher
         
     | 
| 
       47 
     | 
    
         
            -
              end
         
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
       49 
     | 
    
         
            -
              it "retrieves a district's sections" do
         
     | 
| 
       50 
     | 
    
         
            -
                assert_valid_object_list 'sections', 100, Clever::Section
         
     | 
| 
       51 
     | 
    
         
            -
              end
         
     | 
| 
       52 
     | 
    
         
            -
             
     | 
| 
       53 
     | 
    
         
            -
              it "retrieves a district's students" do
         
     | 
| 
       54 
     | 
    
         
            -
                assert_valid_object_list 'students', 100, Clever::Student
         
     | 
| 
       55 
     | 
    
         
            -
              end
         
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
              it "retrieves a district's events" do
         
     | 
| 
       58 
     | 
    
         
            -
                assert_valid_object_list 'events', 13, Clever::Event
         
     | 
| 
       59 
     | 
    
         
            -
              end
         
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
              it "retrieves a district's students with a small filter" do
         
     | 
| 
       62 
     | 
    
         
            -
                VCR.use_cassette('districts_students_filtered') do
         
     | 
| 
       63 
     | 
    
         
            -
                  @district = Clever::District.all.first
         
     | 
| 
       64 
     | 
    
         
            -
                  @district.students(limit: 2).size.must_equal 2
         
     | 
| 
      
 33 
     | 
    
         
            +
              # TODO: this is outdated and should be removed!
         
     | 
| 
      
 34 
     | 
    
         
            +
              describe 'pages methods' do
         
     | 
| 
      
 35 
     | 
    
         
            +
                it "pages a district's schools" do
         
     | 
| 
      
 36 
     | 
    
         
            +
                  assert_valid_object_pages 'school', 2, 2
         
     | 
| 
       65 
37 
     | 
    
         
             
                end
         
     | 
| 
       66 
     | 
    
         
            -
              end
         
     | 
| 
       67 
38 
     | 
    
         | 
| 
       68 
     | 
    
         
            -
             
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
             
     | 
| 
       71 
     | 
    
         
            -
             
     | 
| 
       72 
     | 
    
         
            -
              it "pages a district's teachers" do
         
     | 
| 
       73 
     | 
    
         
            -
                assert_valid_object_pages 'teacher', 10, 9
         
     | 
| 
       74 
     | 
    
         
            -
              end
         
     | 
| 
      
 39 
     | 
    
         
            +
                it "pages a district's teachers" do
         
     | 
| 
      
 40 
     | 
    
         
            +
                  assert_valid_object_pages 'teacher', 10, 9
         
     | 
| 
      
 41 
     | 
    
         
            +
                end
         
     | 
| 
       75 
42 
     | 
    
         | 
| 
       76 
     | 
    
         
            -
             
     | 
| 
       77 
     | 
    
         
            -
             
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
      
 43 
     | 
    
         
            +
                it "pages a district's sections" do
         
     | 
| 
      
 44 
     | 
    
         
            +
                  assert_valid_object_pages 'section', 10, 38
         
     | 
| 
      
 45 
     | 
    
         
            +
                end
         
     | 
| 
       79 
46 
     | 
    
         | 
| 
       80 
     | 
    
         
            -
             
     | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
      
 47 
     | 
    
         
            +
                it "pages a district's students" do
         
     | 
| 
      
 48 
     | 
    
         
            +
                  assert_valid_object_pages 'student', 50, 21
         
     | 
| 
      
 49 
     | 
    
         
            +
                end
         
     | 
| 
       83 
50 
     | 
    
         | 
| 
       84 
     | 
    
         
            -
             
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
      
 51 
     | 
    
         
            +
                it "pages a district's events" do
         
     | 
| 
      
 52 
     | 
    
         
            +
                  assert_valid_object_pages 'event', 1, 8
         
     | 
| 
      
 53 
     | 
    
         
            +
                end
         
     | 
| 
       86 
54 
     | 
    
         
             
              end
         
     | 
| 
       87 
55 
     | 
    
         
             
            end
         
     | 
| 
         @@ -12,7 +12,7 @@ describe 'Error handling' do 
     | 
|
| 
       12 
12 
     | 
    
         
             
                VCR.use_cassette('error_handling') do
         
     | 
| 
       13 
13 
     | 
    
         
             
                  @district = Clever::District.all.first
         
     | 
| 
       14 
14 
     | 
    
         
             
                  lambda do
         
     | 
| 
       15 
     | 
    
         
            -
                    @district.events 
     | 
| 
      
 15 
     | 
    
         
            +
                    @district.events(created_since: '2013-02-15T 2:30:42 0000').first
         
     | 
| 
       16 
16 
     | 
    
         
             
                  end.must_raise Clever::InvalidRequestError
         
     | 
| 
       17 
17 
     | 
    
         
             
                end
         
     | 
| 
       18 
18 
     | 
    
         
             
              end
         
     | 
| 
         @@ -0,0 +1,27 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe Clever::NestedResource do
         
     | 
| 
      
 4 
     | 
    
         
            +
              before do
         
     | 
| 
      
 5 
     | 
    
         
            +
                Clever.configure do |config|
         
     | 
| 
      
 6 
     | 
    
         
            +
                  config.token = 'DEMO_TOKEN'
         
     | 
| 
      
 7 
     | 
    
         
            +
                end
         
     | 
| 
      
 8 
     | 
    
         
            +
              end
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
              [Clever::District, Clever::School, Clever::Student,
         
     | 
| 
      
 11 
     | 
    
         
            +
               Clever::Event, Clever::Section, Clever::Teacher].each do |resource|
         
     | 
| 
      
 12 
     | 
    
         
            +
                next if resource.linked_resources.nil?
         
     | 
| 
      
 13 
     | 
    
         
            +
                resource.linked_resources.each do |link|
         
     | 
| 
      
 14 
     | 
    
         
            +
                  it "retrieves a #{resource.shortname}'s #{link}" do
         
     | 
| 
      
 15 
     | 
    
         
            +
                    VCR.use_cassette("#{resource.shortname}_#{link}") do
         
     | 
| 
      
 16 
     | 
    
         
            +
                      result = resource.find.first.send link
         
     | 
| 
      
 17 
     | 
    
         
            +
                      if Clever::Util.singular?(link.to_s)
         
     | 
| 
      
 18 
     | 
    
         
            +
                        result.must_be_instance_of Clever::APIResource.named(link.to_s)
         
     | 
| 
      
 19 
     | 
    
         
            +
                      else
         
     | 
| 
      
 20 
     | 
    
         
            +
                        result.must_be_instance_of Clever::NestedResource
         
     | 
| 
      
 21 
     | 
    
         
            +
                        result.size.must_equal result.count # check count request measures actual data size
         
     | 
| 
      
 22 
     | 
    
         
            +
                      end
         
     | 
| 
      
 23 
     | 
    
         
            +
                    end
         
     | 
| 
      
 24 
     | 
    
         
            +
                  end
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,32 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            describe Clever::APIResource do
         
     | 
| 
      
 4 
     | 
    
         
            +
              describe :named do
         
     | 
| 
      
 5 
     | 
    
         
            +
                let :resources do
         
     | 
| 
      
 6 
     | 
    
         
            +
                  { district: Clever::District,
         
     | 
| 
      
 7 
     | 
    
         
            +
                    school: Clever::School,
         
     | 
| 
      
 8 
     | 
    
         
            +
                    section: Clever::Section,
         
     | 
| 
      
 9 
     | 
    
         
            +
                    event: Clever::Event,
         
     | 
| 
      
 10 
     | 
    
         
            +
                    teacher: Clever::Teacher,
         
     | 
| 
      
 11 
     | 
    
         
            +
                    student: Clever::Student }
         
     | 
| 
      
 12 
     | 
    
         
            +
                end
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                it 'returns nil on nonexistent resources' do
         
     | 
| 
      
 15 
     | 
    
         
            +
                  Clever::APIResource.named('fake_resource').must_equal nil
         
     | 
| 
      
 16 
     | 
    
         
            +
                end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                it 'returns valid responses for both symbol and string inputs' do
         
     | 
| 
      
 19 
     | 
    
         
            +
                  resources.each do |res_name, klass|
         
     | 
| 
      
 20 
     | 
    
         
            +
                    Clever::APIResource.named(res_name.to_s).must_equal klass
         
     | 
| 
      
 21 
     | 
    
         
            +
                    Clever::APIResource.named(res_name.to_sym).must_equal klass
         
     | 
| 
      
 22 
     | 
    
         
            +
                  end
         
     | 
| 
      
 23 
     | 
    
         
            +
                end
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
                it 'returns valid responses for both singular and plural words' do
         
     | 
| 
      
 26 
     | 
    
         
            +
                  resources.each do |res_name, klass|
         
     | 
| 
      
 27 
     | 
    
         
            +
                    Clever::APIResource.named(res_name.to_s).must_equal klass
         
     | 
| 
      
 28 
     | 
    
         
            +
                    Clever::APIResource.named(res_name.to_s.pluralize).must_equal klass
         
     | 
| 
      
 29 
     | 
    
         
            +
                  end
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -13,27 +13,21 @@ describe 'Optional attributes' do 
     | 
|
| 
       13 
13 
     | 
    
         
             
              end
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
              it 'returns nil for an optional attribute that isnt present' do
         
     | 
| 
       16 
     | 
    
         
            -
                school =  
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
                # add an attribute that will not be exist in the test data
         
     | 
| 
       19 
     | 
    
         
            -
                ops = school.optional_attributes
         
     | 
| 
       20 
     | 
    
         
            -
                ops << :legit_attribute
         
     | 
| 
       21 
     | 
    
         
            -
                Clever::School.class_eval "
         
     | 
| 
       22 
     | 
    
         
            -
                  def optional_attributes
         
     | 
| 
       23 
     | 
    
         
            -
                    #{ops}
         
     | 
| 
       24 
     | 
    
         
            -
                  end"
         
     | 
| 
      
 16 
     | 
    
         
            +
                school = Clever::School.new 1
         
     | 
| 
       25 
17 
     | 
    
         | 
| 
       26 
18 
     | 
    
         
             
                # Must not raise a NoMethodError.
         
     | 
| 
       27 
     | 
    
         
            -
                school. 
     | 
| 
      
 19 
     | 
    
         
            +
                school.state_id.must_equal nil
         
     | 
| 
       28 
20 
     | 
    
         
             
              end
         
     | 
| 
       29 
21 
     | 
    
         | 
| 
       30 
22 
     | 
    
         
             
              it 'has the expected value for an optional attribute that is present' do
         
     | 
| 
       31 
     | 
    
         
            -
                 
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
      
 23 
     | 
    
         
            +
                VCR.use_cassette('optional_present') do
         
     | 
| 
      
 24 
     | 
    
         
            +
                  school = @schools.find { |s| s.id == '530e595026403103360ff9fd' }
         
     | 
| 
      
 25 
     | 
    
         
            +
                  school.state_id.must_equal '712345'
         
     | 
| 
      
 26 
     | 
    
         
            +
                end
         
     | 
| 
       33 
27 
     | 
    
         
             
              end
         
     | 
| 
       34 
28 
     | 
    
         | 
| 
       35 
29 
     | 
    
         
             
              it 'raises a NoMethodError for an invalid attribute' do
         
     | 
| 
       36 
     | 
    
         
            -
                school =  
     | 
| 
      
 30 
     | 
    
         
            +
                school = Clever::School.new 1
         
     | 
| 
       37 
31 
     | 
    
         
             
                -> { school.some_attribute_that_doesnt_exist }.must_raise NoMethodError
         
     | 
| 
       38 
32 
     | 
    
         
             
              end
         
     | 
| 
       39 
33 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: clever-ruby
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.7.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Clever Dev
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-09- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-09-13 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: multi_json
         
     | 
| 
         @@ -185,6 +185,7 @@ files: 
     | 
|
| 
       185 
185 
     | 
    
         
             
            - clever-ruby.gemspec
         
     | 
| 
       186 
186 
     | 
    
         
             
            - lib/clever-ruby.rb
         
     | 
| 
       187 
187 
     | 
    
         
             
            - lib/clever-ruby/api_operations/list.rb
         
     | 
| 
      
 188 
     | 
    
         
            +
            - lib/clever-ruby/api_operations/nested_list.rb
         
     | 
| 
       188 
189 
     | 
    
         
             
            - lib/clever-ruby/api_operations/page.rb
         
     | 
| 
       189 
190 
     | 
    
         
             
            - lib/clever-ruby/api_operations/pagelist.rb
         
     | 
| 
       190 
191 
     | 
    
         
             
            - lib/clever-ruby/api_operations/results_list.rb
         
     | 
| 
         @@ -199,6 +200,7 @@ files: 
     | 
|
| 
       199 
200 
     | 
    
         
             
            - lib/clever-ruby/errors/invalid_request_error.rb
         
     | 
| 
       200 
201 
     | 
    
         
             
            - lib/clever-ruby/event.rb
         
     | 
| 
       201 
202 
     | 
    
         
             
            - lib/clever-ruby/json.rb
         
     | 
| 
      
 203 
     | 
    
         
            +
            - lib/clever-ruby/nested_resource.rb
         
     | 
| 
       202 
204 
     | 
    
         
             
            - lib/clever-ruby/school.rb
         
     | 
| 
       203 
205 
     | 
    
         
             
            - lib/clever-ruby/section.rb
         
     | 
| 
       204 
206 
     | 
    
         
             
            - lib/clever-ruby/student.rb
         
     | 
| 
         @@ -206,21 +208,20 @@ files: 
     | 
|
| 
       206 
208 
     | 
    
         
             
            - lib/clever-ruby/util.rb
         
     | 
| 
       207 
209 
     | 
    
         
             
            - lib/clever-ruby/version.rb
         
     | 
| 
       208 
210 
     | 
    
         
             
            - test/data/vcr_cassettes/district_count.yml
         
     | 
| 
      
 211 
     | 
    
         
            +
            - test/data/vcr_cassettes/district_events.yml
         
     | 
| 
       209 
212 
     | 
    
         
             
            - test/data/vcr_cassettes/district_find_by_page.yml
         
     | 
| 
       210 
213 
     | 
    
         
             
            - test/data/vcr_cassettes/district_find_multiple.yml
         
     | 
| 
       211 
214 
     | 
    
         
             
            - test/data/vcr_cassettes/district_find_one.yml
         
     | 
| 
      
 215 
     | 
    
         
            +
            - test/data/vcr_cassettes/district_schools.yml
         
     | 
| 
      
 216 
     | 
    
         
            +
            - test/data/vcr_cassettes/district_sections.yml
         
     | 
| 
      
 217 
     | 
    
         
            +
            - test/data/vcr_cassettes/district_students.yml
         
     | 
| 
      
 218 
     | 
    
         
            +
            - test/data/vcr_cassettes/district_teachers.yml
         
     | 
| 
       212 
219 
     | 
    
         
             
            - test/data/vcr_cassettes/districts.yml
         
     | 
| 
       213 
220 
     | 
    
         
             
            - test/data/vcr_cassettes/districts_event_pages.yml
         
     | 
| 
       214 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_events.yml
         
     | 
| 
       215 
221 
     | 
    
         
             
            - test/data/vcr_cassettes/districts_school_pages.yml
         
     | 
| 
       216 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_schools.yml
         
     | 
| 
       217 
222 
     | 
    
         
             
            - test/data/vcr_cassettes/districts_section_pages.yml
         
     | 
| 
       218 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_sections.yml
         
     | 
| 
       219 
223 
     | 
    
         
             
            - test/data/vcr_cassettes/districts_student_pages.yml
         
     | 
| 
       220 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_students.yml
         
     | 
| 
       221 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_students_filtered.yml
         
     | 
| 
       222 
224 
     | 
    
         
             
            - test/data/vcr_cassettes/districts_teacher_pages.yml
         
     | 
| 
       223 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_teachers.yml
         
     | 
| 
       224 
225 
     | 
    
         
             
            - test/data/vcr_cassettes/error_handling.yml
         
     | 
| 
       225 
226 
     | 
    
         
             
            - test/data/vcr_cassettes/event_count.yml
         
     | 
| 
       226 
227 
     | 
    
         
             
            - test/data/vcr_cassettes/event_find_by_page.yml
         
     | 
| 
         @@ -228,30 +229,53 @@ files: 
     | 
|
| 
       228 
229 
     | 
    
         
             
            - test/data/vcr_cassettes/event_find_one.yml
         
     | 
| 
       229 
230 
     | 
    
         
             
            - test/data/vcr_cassettes/events.yml
         
     | 
| 
       230 
231 
     | 
    
         
             
            - test/data/vcr_cassettes/school_count.yml
         
     | 
| 
      
 232 
     | 
    
         
            +
            - test/data/vcr_cassettes/school_district.yml
         
     | 
| 
      
 233 
     | 
    
         
            +
            - test/data/vcr_cassettes/school_events.yml
         
     | 
| 
       231 
234 
     | 
    
         
             
            - test/data/vcr_cassettes/school_find_by_page.yml
         
     | 
| 
       232 
235 
     | 
    
         
             
            - test/data/vcr_cassettes/school_find_multiple.yml
         
     | 
| 
       233 
236 
     | 
    
         
             
            - test/data/vcr_cassettes/school_find_one.yml
         
     | 
| 
      
 237 
     | 
    
         
            +
            - test/data/vcr_cassettes/school_sections.yml
         
     | 
| 
      
 238 
     | 
    
         
            +
            - test/data/vcr_cassettes/school_students.yml
         
     | 
| 
      
 239 
     | 
    
         
            +
            - test/data/vcr_cassettes/school_teachers.yml
         
     | 
| 
       234 
240 
     | 
    
         
             
            - test/data/vcr_cassettes/schools.yml
         
     | 
| 
       235 
241 
     | 
    
         
             
            - test/data/vcr_cassettes/schools_optional_attributes.yml
         
     | 
| 
       236 
242 
     | 
    
         
             
            - test/data/vcr_cassettes/section_count.yml
         
     | 
| 
      
 243 
     | 
    
         
            +
            - test/data/vcr_cassettes/section_district.yml
         
     | 
| 
      
 244 
     | 
    
         
            +
            - test/data/vcr_cassettes/section_events.yml
         
     | 
| 
       237 
245 
     | 
    
         
             
            - test/data/vcr_cassettes/section_find_by_page.yml
         
     | 
| 
       238 
246 
     | 
    
         
             
            - test/data/vcr_cassettes/section_find_multiple.yml
         
     | 
| 
       239 
247 
     | 
    
         
             
            - test/data/vcr_cassettes/section_find_one.yml
         
     | 
| 
      
 248 
     | 
    
         
            +
            - test/data/vcr_cassettes/section_school.yml
         
     | 
| 
      
 249 
     | 
    
         
            +
            - test/data/vcr_cassettes/section_students.yml
         
     | 
| 
      
 250 
     | 
    
         
            +
            - test/data/vcr_cassettes/section_teacher.yml
         
     | 
| 
       240 
251 
     | 
    
         
             
            - test/data/vcr_cassettes/sections.yml
         
     | 
| 
       241 
252 
     | 
    
         
             
            - test/data/vcr_cassettes/student_count.yml
         
     | 
| 
      
 253 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_district.yml
         
     | 
| 
      
 254 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_events.yml
         
     | 
| 
       242 
255 
     | 
    
         
             
            - test/data/vcr_cassettes/student_find_by_page.yml
         
     | 
| 
       243 
256 
     | 
    
         
             
            - test/data/vcr_cassettes/student_find_multiple.yml
         
     | 
| 
       244 
257 
     | 
    
         
             
            - test/data/vcr_cassettes/student_find_one.yml
         
     | 
| 
      
 258 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_school.yml
         
     | 
| 
      
 259 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_sections.yml
         
     | 
| 
      
 260 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_teacher.yml
         
     | 
| 
      
 261 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_teachers.yml
         
     | 
| 
       245 
262 
     | 
    
         
             
            - test/data/vcr_cassettes/students.yml
         
     | 
| 
       246 
263 
     | 
    
         
             
            - test/data/vcr_cassettes/teacher_count.yml
         
     | 
| 
      
 264 
     | 
    
         
            +
            - test/data/vcr_cassettes/teacher_district.yml
         
     | 
| 
      
 265 
     | 
    
         
            +
            - test/data/vcr_cassettes/teacher_events.yml
         
     | 
| 
       247 
266 
     | 
    
         
             
            - test/data/vcr_cassettes/teacher_find_by_page.yml
         
     | 
| 
       248 
267 
     | 
    
         
             
            - test/data/vcr_cassettes/teacher_find_multiple.yml
         
     | 
| 
       249 
268 
     | 
    
         
             
            - test/data/vcr_cassettes/teacher_find_one.yml
         
     | 
| 
      
 269 
     | 
    
         
            +
            - test/data/vcr_cassettes/teacher_school.yml
         
     | 
| 
      
 270 
     | 
    
         
            +
            - test/data/vcr_cassettes/teacher_sections.yml
         
     | 
| 
      
 271 
     | 
    
         
            +
            - test/data/vcr_cassettes/teacher_students.yml
         
     | 
| 
       250 
272 
     | 
    
         
             
            - test/data/vcr_cassettes/teachers.yml
         
     | 
| 
       251 
273 
     | 
    
         
             
            - test/integration/api_operations/list_test.rb
         
     | 
| 
       252 
274 
     | 
    
         
             
            - test/integration/district_test.rb
         
     | 
| 
       253 
275 
     | 
    
         
             
            - test/integration/error_handling_test.rb
         
     | 
| 
      
 276 
     | 
    
         
            +
            - test/integration/nested_resource_test.rb
         
     | 
| 
       254 
277 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
      
 278 
     | 
    
         
            +
            - test/unit/api_resource_test.rb
         
     | 
| 
       255 
279 
     | 
    
         
             
            - test/unit/clever_test.rb
         
     | 
| 
       256 
280 
     | 
    
         
             
            - test/unit/configuration_test.rb
         
     | 
| 
       257 
281 
     | 
    
         
             
            - test/unit/event_test.rb
         
     | 
| 
         @@ -281,21 +305,20 @@ specification_version: 4 
     | 
|
| 
       281 
305 
     | 
    
         
             
            summary: Ruby bindings to the Clever API.
         
     | 
| 
       282 
306 
     | 
    
         
             
            test_files:
         
     | 
| 
       283 
307 
     | 
    
         
             
            - test/data/vcr_cassettes/district_count.yml
         
     | 
| 
      
 308 
     | 
    
         
            +
            - test/data/vcr_cassettes/district_events.yml
         
     | 
| 
       284 
309 
     | 
    
         
             
            - test/data/vcr_cassettes/district_find_by_page.yml
         
     | 
| 
       285 
310 
     | 
    
         
             
            - test/data/vcr_cassettes/district_find_multiple.yml
         
     | 
| 
       286 
311 
     | 
    
         
             
            - test/data/vcr_cassettes/district_find_one.yml
         
     | 
| 
      
 312 
     | 
    
         
            +
            - test/data/vcr_cassettes/district_schools.yml
         
     | 
| 
      
 313 
     | 
    
         
            +
            - test/data/vcr_cassettes/district_sections.yml
         
     | 
| 
      
 314 
     | 
    
         
            +
            - test/data/vcr_cassettes/district_students.yml
         
     | 
| 
      
 315 
     | 
    
         
            +
            - test/data/vcr_cassettes/district_teachers.yml
         
     | 
| 
       287 
316 
     | 
    
         
             
            - test/data/vcr_cassettes/districts.yml
         
     | 
| 
       288 
317 
     | 
    
         
             
            - test/data/vcr_cassettes/districts_event_pages.yml
         
     | 
| 
       289 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_events.yml
         
     | 
| 
       290 
318 
     | 
    
         
             
            - test/data/vcr_cassettes/districts_school_pages.yml
         
     | 
| 
       291 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_schools.yml
         
     | 
| 
       292 
319 
     | 
    
         
             
            - test/data/vcr_cassettes/districts_section_pages.yml
         
     | 
| 
       293 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_sections.yml
         
     | 
| 
       294 
320 
     | 
    
         
             
            - test/data/vcr_cassettes/districts_student_pages.yml
         
     | 
| 
       295 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_students.yml
         
     | 
| 
       296 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_students_filtered.yml
         
     | 
| 
       297 
321 
     | 
    
         
             
            - test/data/vcr_cassettes/districts_teacher_pages.yml
         
     | 
| 
       298 
     | 
    
         
            -
            - test/data/vcr_cassettes/districts_teachers.yml
         
     | 
| 
       299 
322 
     | 
    
         
             
            - test/data/vcr_cassettes/error_handling.yml
         
     | 
| 
       300 
323 
     | 
    
         
             
            - test/data/vcr_cassettes/event_count.yml
         
     | 
| 
       301 
324 
     | 
    
         
             
            - test/data/vcr_cassettes/event_find_by_page.yml
         
     | 
| 
         @@ -303,30 +326,53 @@ test_files: 
     | 
|
| 
       303 
326 
     | 
    
         
             
            - test/data/vcr_cassettes/event_find_one.yml
         
     | 
| 
       304 
327 
     | 
    
         
             
            - test/data/vcr_cassettes/events.yml
         
     | 
| 
       305 
328 
     | 
    
         
             
            - test/data/vcr_cassettes/school_count.yml
         
     | 
| 
      
 329 
     | 
    
         
            +
            - test/data/vcr_cassettes/school_district.yml
         
     | 
| 
      
 330 
     | 
    
         
            +
            - test/data/vcr_cassettes/school_events.yml
         
     | 
| 
       306 
331 
     | 
    
         
             
            - test/data/vcr_cassettes/school_find_by_page.yml
         
     | 
| 
       307 
332 
     | 
    
         
             
            - test/data/vcr_cassettes/school_find_multiple.yml
         
     | 
| 
       308 
333 
     | 
    
         
             
            - test/data/vcr_cassettes/school_find_one.yml
         
     | 
| 
      
 334 
     | 
    
         
            +
            - test/data/vcr_cassettes/school_sections.yml
         
     | 
| 
      
 335 
     | 
    
         
            +
            - test/data/vcr_cassettes/school_students.yml
         
     | 
| 
      
 336 
     | 
    
         
            +
            - test/data/vcr_cassettes/school_teachers.yml
         
     | 
| 
       309 
337 
     | 
    
         
             
            - test/data/vcr_cassettes/schools.yml
         
     | 
| 
       310 
338 
     | 
    
         
             
            - test/data/vcr_cassettes/schools_optional_attributes.yml
         
     | 
| 
       311 
339 
     | 
    
         
             
            - test/data/vcr_cassettes/section_count.yml
         
     | 
| 
      
 340 
     | 
    
         
            +
            - test/data/vcr_cassettes/section_district.yml
         
     | 
| 
      
 341 
     | 
    
         
            +
            - test/data/vcr_cassettes/section_events.yml
         
     | 
| 
       312 
342 
     | 
    
         
             
            - test/data/vcr_cassettes/section_find_by_page.yml
         
     | 
| 
       313 
343 
     | 
    
         
             
            - test/data/vcr_cassettes/section_find_multiple.yml
         
     | 
| 
       314 
344 
     | 
    
         
             
            - test/data/vcr_cassettes/section_find_one.yml
         
     | 
| 
      
 345 
     | 
    
         
            +
            - test/data/vcr_cassettes/section_school.yml
         
     | 
| 
      
 346 
     | 
    
         
            +
            - test/data/vcr_cassettes/section_students.yml
         
     | 
| 
      
 347 
     | 
    
         
            +
            - test/data/vcr_cassettes/section_teacher.yml
         
     | 
| 
       315 
348 
     | 
    
         
             
            - test/data/vcr_cassettes/sections.yml
         
     | 
| 
       316 
349 
     | 
    
         
             
            - test/data/vcr_cassettes/student_count.yml
         
     | 
| 
      
 350 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_district.yml
         
     | 
| 
      
 351 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_events.yml
         
     | 
| 
       317 
352 
     | 
    
         
             
            - test/data/vcr_cassettes/student_find_by_page.yml
         
     | 
| 
       318 
353 
     | 
    
         
             
            - test/data/vcr_cassettes/student_find_multiple.yml
         
     | 
| 
       319 
354 
     | 
    
         
             
            - test/data/vcr_cassettes/student_find_one.yml
         
     | 
| 
      
 355 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_school.yml
         
     | 
| 
      
 356 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_sections.yml
         
     | 
| 
      
 357 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_teacher.yml
         
     | 
| 
      
 358 
     | 
    
         
            +
            - test/data/vcr_cassettes/student_teachers.yml
         
     | 
| 
       320 
359 
     | 
    
         
             
            - test/data/vcr_cassettes/students.yml
         
     | 
| 
       321 
360 
     | 
    
         
             
            - test/data/vcr_cassettes/teacher_count.yml
         
     | 
| 
      
 361 
     | 
    
         
            +
            - test/data/vcr_cassettes/teacher_district.yml
         
     | 
| 
      
 362 
     | 
    
         
            +
            - test/data/vcr_cassettes/teacher_events.yml
         
     | 
| 
       322 
363 
     | 
    
         
             
            - test/data/vcr_cassettes/teacher_find_by_page.yml
         
     | 
| 
       323 
364 
     | 
    
         
             
            - test/data/vcr_cassettes/teacher_find_multiple.yml
         
     | 
| 
       324 
365 
     | 
    
         
             
            - test/data/vcr_cassettes/teacher_find_one.yml
         
     | 
| 
      
 366 
     | 
    
         
            +
            - test/data/vcr_cassettes/teacher_school.yml
         
     | 
| 
      
 367 
     | 
    
         
            +
            - test/data/vcr_cassettes/teacher_sections.yml
         
     | 
| 
      
 368 
     | 
    
         
            +
            - test/data/vcr_cassettes/teacher_students.yml
         
     | 
| 
       325 
369 
     | 
    
         
             
            - test/data/vcr_cassettes/teachers.yml
         
     | 
| 
       326 
370 
     | 
    
         
             
            - test/integration/api_operations/list_test.rb
         
     | 
| 
       327 
371 
     | 
    
         
             
            - test/integration/district_test.rb
         
     | 
| 
       328 
372 
     | 
    
         
             
            - test/integration/error_handling_test.rb
         
     | 
| 
      
 373 
     | 
    
         
            +
            - test/integration/nested_resource_test.rb
         
     | 
| 
       329 
374 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
      
 375 
     | 
    
         
            +
            - test/unit/api_resource_test.rb
         
     | 
| 
       330 
376 
     | 
    
         
             
            - test/unit/clever_test.rb
         
     | 
| 
       331 
377 
     | 
    
         
             
            - test/unit/configuration_test.rb
         
     | 
| 
       332 
378 
     | 
    
         
             
            - test/unit/event_test.rb
         
     |