clever-ruby 0.11.1 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +15 -1
  4. data/clever-ruby.gemspec +0 -1
  5. data/lib/clever-ruby.rb +1 -1
  6. data/lib/clever-ruby/api_resource.rb +43 -7
  7. data/lib/clever-ruby/district.rb +14 -0
  8. data/lib/clever-ruby/event.rb +2 -0
  9. data/lib/clever-ruby/school.rb +2 -0
  10. data/lib/clever-ruby/school_admin.rb +17 -0
  11. data/lib/clever-ruby/section.rb +2 -0
  12. data/lib/clever-ruby/student.rb +2 -0
  13. data/lib/clever-ruby/teacher.rb +2 -0
  14. data/lib/clever-ruby/util.rb +1 -9
  15. data/lib/clever-ruby/version.rb +1 -1
  16. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_district_properly.yml +14 -8
  17. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_event_properly.yml +14 -8
  18. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_school_admin_properly.yml +52 -0
  19. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_school_properly.yml +14 -8
  20. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_section_properly.yml +14 -8
  21. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_student_properly.yml +14 -8
  22. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_teacher_properly.yml +14 -8
  23. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_district.yml +28 -16
  24. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_event.yml +28 -16
  25. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_school.yml +28 -18
  26. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_school_admin.yml +101 -0
  27. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_section.yml +30 -18
  28. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_student.yml +30 -18
  29. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_teacher.yml +28 -18
  30. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_districts_by_page.yml +28 -16
  31. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_districts_with_multiple_ids.yml +28 -16
  32. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_events_by_page.yml +24 -10
  33. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_events_with_multiple_ids.yml +30 -18
  34. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_school_admins_by_page.yml +101 -0
  35. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_school_admins_with_multiple_ids.yml +101 -0
  36. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_schools_by_page.yml +28 -18
  37. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_schools_with_multiple_ids.yml +28 -20
  38. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_sections_by_page.yml +34 -22
  39. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_sections_with_multiple_ids.yml +30 -18
  40. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_students_by_page.yml +48 -36
  41. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_students_with_multiple_ids.yml +30 -18
  42. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_teachers_by_page.yml +27 -17
  43. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_teachers_with_multiple_ids.yml +28 -20
  44. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_district.yml +28 -16
  45. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_event.yml +28 -14
  46. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_school.yml +28 -18
  47. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_school_admin.yml +101 -0
  48. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_section.yml +34 -22
  49. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_student.yml +48 -36
  50. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_teacher.yml +30 -20
  51. data/test/data/vcr_cassettes/Clever_District_without_global_token/pages_methods/pages_a_district_s_events.yml +39 -19
  52. data/test/data/vcr_cassettes/Clever_District_without_global_token/pages_methods/pages_a_district_s_schools.yml +36 -22
  53. data/test/data/vcr_cassettes/Clever_District_without_global_token/pages_methods/pages_a_district_s_sections.yml +37 -19
  54. data/test/data/vcr_cassettes/Clever_District_without_global_token/pages_methods/pages_a_district_s_students.yml +37 -19
  55. data/test/data/vcr_cassettes/Clever_District_without_global_token/pages_methods/pages_a_district_s_teachers.yml +34 -20
  56. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_school_admins.yml +101 -0
  57. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_schools.yml +25 -15
  58. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_sections.yml +26 -14
  59. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_students.yml +26 -14
  60. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_teachers.yml +25 -15
  61. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_district_s_events.yml +54 -30
  62. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_district_s_schools.yml +50 -30
  63. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_district_s_sections.yml +51 -27
  64. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_district_s_students.yml +51 -27
  65. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_district_s_teachers.yml +50 -30
  66. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_admin_s_schools.yml +205 -0
  67. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_s_district.yml +43 -27
  68. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_s_events.yml +56 -30
  69. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_s_sections.yml +58 -36
  70. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_s_students.yml +69 -45
  71. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_s_teachers.yml +52 -34
  72. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_section_s_district.yml +42 -24
  73. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_section_s_events.yml +58 -30
  74. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_section_s_school.yml +41 -23
  75. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_section_s_students.yml +45 -27
  76. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_section_s_teacher.yml +41 -23
  77. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_student_s_district.yml +42 -24
  78. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_student_s_events.yml +58 -30
  79. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_student_s_school.yml +41 -23
  80. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_student_s_sections.yml +56 -32
  81. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_student_s_teachers.yml +54 -30
  82. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_teacher_s_district.yml +40 -24
  83. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_teacher_s_events.yml +56 -30
  84. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_teacher_s_school.yml +39 -23
  85. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_teacher_s_sections.yml +54 -32
  86. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_teacher_s_students.yml +54 -32
  87. data/test/data/vcr_cassettes/Error_handling/raises_an_InvalidRequestError_when_given_a_bad_created_since.yml +42 -24
  88. data/test/data/vcr_cassettes/Optional_attributes/has_the_expected_value_for_an_optional_attribute_that_is_present.yml +13 -7
  89. data/test/data/vcr_cassettes/last_method/page/has_working_first_and_last_methods.yml +142 -61
  90. data/test/integration/api_operations/list_test.rb +5 -3
  91. data/test/integration/district_with_non_global_token_test.rb +7 -0
  92. data/test/integration/last_test.rb +3 -2
  93. data/test/integration/nested_resource_test.rb +3 -2
  94. data/test/unit/api_resource_test.rb +29 -14
  95. data/test/unit/clever_test.rb +1 -0
  96. metadata +17 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0039ae3dc00766830c25a98b0103c15c4c0a15a2
4
- data.tar.gz: de6f1ccf28e1b444ebe267cc7a63256b075ca134
3
+ metadata.gz: 3fbf4a2b0e378bcb5b8b6ddf915b9a893637d817
4
+ data.tar.gz: d4e7d196ec9472367e3055c7af19ac76de4150fd
5
5
  SHA512:
6
- metadata.gz: b5284126d1c005cdddf2abca0a0ef5ddb238e2907455d0c70b46caa21bfce038242c50c68254413bb5d1a18823a08fda0ed8c540570ec5f52000ada08352022b
7
- data.tar.gz: 10e619159f21dfb3f3c2469f3d9a5a25328a34f6e6a24e58c27e832f156c99a217f3fef292f43a3346278b5d47ef53b71598b232f89d7da55064e2419a674454
6
+ metadata.gz: 74b6cb015615bb153bc3b04b9d6c9d6a1a0eff230af5becb19d566996cb5c45c6bf69f9015eb36b9d1ab14a502fabd409a0ab7a9a65f54a565a510bbd839e747
7
+ data.tar.gz: 4bb8fba062d4766b7f6e770965ffa221c9ee321f1f260f47de38fa360b6218e4d38d592519bfd5727013602eafedf13833b7149203a222e8015ff9606aa0915a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.13.0 (2015-10-05)
2
+
3
+ * Add support for school admins
4
+
5
+ ## 0.12.0 (2015-09-28)
6
+
7
+ * Remove inflector dependency
8
+
1
9
  ## 0.11.1 (2015-09-28)
2
10
 
3
11
  * Fix APIError throwing a TypeError when API requests fail
data/README.md CHANGED
@@ -45,6 +45,12 @@ To run all tests:
45
45
  $ rake test
46
46
  ```
47
47
 
48
+ To run a specific test file, for example `test/unit/clever_test.rb`:
49
+
50
+ ```bash
51
+ $ rake test TEST=test/unit/clever_test.rb
52
+ ```
53
+
48
54
  To run all tests and the linter ([rubocop](https://github.com/bbatsov/rubocop)):
49
55
 
50
56
  ```bash
@@ -57,7 +63,15 @@ The linter follows the [Ruby Style Guide](https://github.com/bbatsov/ruby-style-
57
63
  $ rake lint
58
64
  ```
59
65
 
60
- Running specific tests is not currently supported.
66
+ ### Updating VCR cassettes
67
+
68
+ It is not currently possible to easily recreate the scenario in which the original VCR cassettes were recorded, especially for the events. If you need to update or add to the recorded requests and responses:
69
+
70
+ * Using a Clever District Admin sandbox account, set up the data to include the updated or added situation.
71
+ * In the tests, **temporarily** replace `DEMO_TOKEN` with the OAuth token of your sandbox district.
72
+ * Remove the existing VCR cassettes that you would like to update so that they will get rerecorded.
73
+ * Run the tests.
74
+ * Using a combination of `git checkout -p`, `git add -p`, find-and-replace, `sed`/`awk`, etc. check into git the updated data and any updated formatting that you want to keep. **Check out and discard any recordings of your `Bearer Token` (so that the cassettes all contain `DEMO_TOKEN`)** and any other irrelevant data changes. Change the IDs of any objects in your added or updated response data to match those of the demo data.
61
75
 
62
76
  ## Documentation
63
77
 
data/clever-ruby.gemspec CHANGED
@@ -21,7 +21,6 @@ Gem::Specification.new do |gem|
21
21
 
22
22
  gem.add_runtime_dependency 'multi_json', '~> 1.10.0'
23
23
  gem.add_runtime_dependency 'rest-client', '~> 1.6.7'
24
- gem.add_runtime_dependency 'activesupport', '~> 4.2.1'
25
24
 
26
25
  gem.add_development_dependency 'rake'
27
26
  gem.add_development_dependency 'minitest', '~> 5.4.1'
data/lib/clever-ruby.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # rubocop:disable FileName
2
2
  require 'rest_client'
3
3
  require 'multi_json'
4
- require 'active_support/inflector'
5
4
  require 'open-uri'
6
5
  require 'set'
7
6
  require 'uri'
@@ -32,6 +31,7 @@ require 'clever-ruby/student'
32
31
  require 'clever-ruby/section'
33
32
  require 'clever-ruby/teacher'
34
33
  require 'clever-ruby/event'
34
+ require 'clever-ruby/school_admin'
35
35
 
36
36
  # Errors
37
37
  require 'clever-ruby/errors/clever_error'
@@ -1,5 +1,6 @@
1
1
  module Clever
2
- # Superclass of API resources in the Clever API
2
+ # Superclass of API resources in the Clever API. API objects are to be
3
+ # singular, not plural; as in class Student, for the /students endpoint.
3
4
  class APIResource < CleverObject
4
5
  @resources = []
5
6
 
@@ -13,6 +14,21 @@ module Clever
13
14
  # @api private
14
15
  # @return [Array] List of resources nested under this resource
15
16
  attr_reader :linked_resources
17
+
18
+ # Get the plural form of a resource's name
19
+ #
20
+ # For instance, for class Student, returns "students"
21
+ # @api private
22
+ # @return [String] Plural name of a resource
23
+ attr_reader :plural
24
+
25
+ # Get the URI corresponding to a resource
26
+ #
27
+ # For instance, for class Student, urls start with /v1.1/students, so
28
+ # this returns "students"
29
+ # @api private
30
+ # @return [String] URI corresponding to a resource
31
+ attr_reader :uri
16
32
  end
17
33
 
18
34
  # Registers valid API resources
@@ -23,19 +39,39 @@ module Clever
23
39
  super
24
40
  end
25
41
 
42
+ # Check if the name of an APIResource is in its singular form
43
+ #
44
+ # For instance, the Student API resource can be referred to as
45
+ # "student" or "students"; this returns true on the former.
46
+ # @api private
47
+ # @param word [String] APIResource name to check
48
+ # @return [Boolean] False if plural, true if singular
49
+ def self.singular?(resource_name)
50
+ klass = named resource_name
51
+ unless klass
52
+ fail 'Clever::APIResource only supports checking singularity of words '\
53
+ 'that refer to children of Clever::APIResource; received ' \
54
+ "'#{resource_name}'"
55
+ end
56
+
57
+ klass.plural != resource_name.downcase
58
+ end
59
+
26
60
  # Get a canonical name for a resource
27
61
  # @api private
28
62
  # @return [String]
29
63
  def self.shortname
30
- name.split('::')[-1].downcase.singularize
64
+ name.split('::')[-1].gsub(/([a-z\d])([A-Z])/, '\1_\2'.freeze).downcase
31
65
  end
32
66
 
33
- # Convert the name of a resource to its APIResource subclass
67
+ # Convert the uri of a resource to its APIResource subclass
34
68
  # @api private
35
69
  # @return [APIResource]
36
70
  def self.named(name)
37
- name = name.to_s.downcase.singularize
38
- matching = resources.select { |res| res.shortname == name }
71
+ name = name.to_s.downcase
72
+ matching = resources.select do |res|
73
+ (name == res.shortname) || (name == res.plural)
74
+ end
39
75
  return nil if matching.empty?
40
76
  matching.first
41
77
  end
@@ -48,7 +84,7 @@ module Clever
48
84
  fail NotImplementedError, 'APIResource is an abstract class. You should perform actions '\
49
85
  'on its subclasses (School, Student, etc.)'
50
86
  end
51
- "v1.1/#{CGI.escape shortname.pluralize}"
87
+ "v1.1/#{uri}"
52
88
  end
53
89
 
54
90
  # Get URL for an instance of a resource
@@ -112,7 +148,7 @@ module Clever
112
148
  return if self.class.linked_resources.nil?
113
149
 
114
150
  self.class.linked_resources.each do |resource|
115
- if Clever::Util.singular? resource.to_s
151
+ if APIResource.singular? resource.to_s
116
152
  # Get single resource
117
153
  self.class.send :define_method, resource do
118
154
  response = Clever.request :get, get_link_uri(resource), {}, headers
@@ -2,6 +2,8 @@ module Clever
2
2
  # District resource
3
3
  class District < APIResource
4
4
  include Clever::APIOperations::List
5
+ @plural = 'districts'
6
+ @uri = 'districts'
5
7
  @linked_resources = [:schools, :teachers, :sections, :students, :events]
6
8
 
7
9
  # Get admins for the current district
@@ -28,6 +30,18 @@ module Clever
28
30
  fail NotImplementedError, 'status nested resource not yet implemented.'
29
31
  end
30
32
 
33
+ # Get school admins for the current district
34
+ # @api public
35
+ # @return [Object]
36
+ # @example
37
+ # district = district.retrieve id
38
+ # school_admins = district.school_admins
39
+ def school_admins(filters = {})
40
+ # The response for a district does not include a link to the school
41
+ # admins URI, so this can't be a linked_resource.
42
+ Clever::NestedResource.new '/v1.1/school_admins', filters, headers
43
+ end
44
+
31
45
  # @see Clever::CleverObject.optional_attributes
32
46
  # @api private
33
47
  # @return [Array]
@@ -2,6 +2,8 @@ module Clever
2
2
  # Event resource
3
3
  class Event < APIResource
4
4
  include Clever::APIOperations::List
5
+ @uri = 'events'
6
+ @plural = 'events'
5
7
 
6
8
  # Optional attributes
7
9
  # @see Clever::CleverObject.optional_attributes
@@ -2,6 +2,8 @@ module Clever
2
2
  # School resource
3
3
  class School < APIResource
4
4
  include Clever::APIOperations::List
5
+ @uri = 'schools'
6
+ @plural = 'schools'
5
7
  @linked_resources = [:students, :district, :sections, :teachers, :events]
6
8
 
7
9
  # Optional attributes
@@ -0,0 +1,17 @@
1
+ module Clever
2
+ # School Admin resource
3
+ class SchoolAdmin < APIResource
4
+ include Clever::APIOperations::List
5
+ @uri = 'school_admins'
6
+ @plural = 'school_admins'
7
+ @linked_resources = [:schools]
8
+
9
+ # Optional attributes
10
+ # @see Clever::CleverObject.optional_attributes
11
+ # @api private
12
+ # @return [Array]
13
+ def optional_attributes
14
+ [:email, :title, :staff_id]
15
+ end
16
+ end
17
+ end
@@ -2,6 +2,8 @@ module Clever
2
2
  # Section resource
3
3
  class Section < APIResource
4
4
  include Clever::APIOperations::List
5
+ @uri = 'sections'
6
+ @plural = 'sections'
5
7
  @linked_resources = [:school, :district, :students, :teacher, :events]
6
8
 
7
9
  # Optional attributes
@@ -2,6 +2,8 @@ module Clever
2
2
  # Student resource
3
3
  class Student < APIResource
4
4
  include Clever::APIOperations::List
5
+ @uri = 'students'
6
+ @plural = 'students'
5
7
  @linked_resources = [:school, :district, :sections, :teachers, :events]
6
8
 
7
9
  # Get contacts for the current student
@@ -2,6 +2,8 @@ module Clever
2
2
  # Teacher resource
3
3
  class Teacher < APIResource
4
4
  include Clever::APIOperations::List
5
+ @uri = 'teachers'
6
+ @plural = 'teachers'
5
7
  @linked_resources = [:school, :district, :students, :sections, :events]
6
8
 
7
9
  # Optional attributes
@@ -1,14 +1,6 @@
1
1
  module Clever
2
2
  # Library helper methods
3
3
  module Util
4
- # Check if a given word is singular
5
- # @api private
6
- # @param word [String] Word to check
7
- # @return [Boolean] False if plural, true if singular
8
- def self.singular?(word)
9
- word.singularize == word
10
- end
11
-
12
4
  # Check if a given ID is a valid format (MongoDB BSON ObjectID)
13
5
  # @api private
14
6
  # @param id [String] ID to check
@@ -51,7 +43,7 @@ module Clever
51
43
  uri = resp[:links].select { |l| l[:rel] == 'self' }[0][:uri]
52
44
  end
53
45
 
54
- klass_name = %r{/v1.1/([a-z]+)/\S+$}.match(uri)[1]
46
+ klass_name = %r{/v1.1/([a-z_]+)/\S+$}.match(uri)[1]
55
47
  klass = APIResource.named klass_name if klass_name
56
48
  klass ||= CleverObject
57
49
  klass.construct_from resp[:data]
@@ -2,5 +2,5 @@
2
2
  module Clever
3
3
  # Version. Follows semantic versioning, as described here:
4
4
  # http://semver.org/
5
- VERSION = '0.11.1'
5
+ VERSION = '0.13.0'
6
6
  end
@@ -8,7 +8,7 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  Accept:
11
- - ! '*/*; q=0.5, application/xml'
11
+ - "*/*; q=0.5, application/xml"
12
12
  Accept-Encoding:
13
13
  - gzip, deflate
14
14
  Authorization:
@@ -25,22 +25,28 @@ http_interactions:
25
25
  Access-Control-Allow-Methods:
26
26
  - GET,PATCH,POST,DELETE
27
27
  Access-Control-Allow-Origin:
28
- - ! '*'
28
+ - "*"
29
29
  Content-Type:
30
30
  - application/json; charset=utf-8
31
31
  Date:
32
- - Sat, 13 Sep 2014 00:03:49 GMT
33
- Server:
34
- - nginx/1.4.7
32
+ - Sat, 26 Sep 2015 17:40:59 GMT
35
33
  X-Powered-By:
36
34
  - Express
35
+ X-Ratelimit-Bucket:
36
+ - bearer
37
+ X-Ratelimit-Limit:
38
+ - '1200'
39
+ X-Ratelimit-Remaining:
40
+ - '1166'
41
+ X-Ratelimit-Reset:
42
+ - '1443289303'
37
43
  Content-Length:
38
44
  - '71'
39
45
  Connection:
40
46
  - keep-alive
41
47
  body:
42
- encoding: US-ASCII
43
- string: ! '{"count":1,"links":[{"rel":"self","uri":"/v1.1/districts?count=true"}]}'
48
+ encoding: UTF-8
49
+ string: '{"count":1,"links":[{"rel":"self","uri":"/v1.1/districts?count=true"}]}'
44
50
  http_version:
45
- recorded_at: Sat, 13 Sep 2014 00:03:49 GMT
51
+ recorded_at: Sat, 26 Sep 2015 17:40:59 GMT
46
52
  recorded_with: VCR 2.9.3
@@ -8,7 +8,7 @@ http_interactions:
8
8
  string: ''
9
9
  headers:
10
10
  Accept:
11
- - ! '*/*; q=0.5, application/xml'
11
+ - "*/*; q=0.5, application/xml"
12
12
  Accept-Encoding:
13
13
  - gzip, deflate
14
14
  Authorization:
@@ -25,22 +25,28 @@ http_interactions:
25
25
  Access-Control-Allow-Methods:
26
26
  - GET,PATCH,POST,DELETE
27
27
  Access-Control-Allow-Origin:
28
- - ! '*'
28
+ - "*"
29
29
  Content-Type:
30
30
  - application/json; charset=utf-8
31
31
  Date:
32
- - Sat, 13 Sep 2014 00:05:05 GMT
33
- Server:
34
- - nginx/1.4.7
32
+ - Sat, 26 Sep 2015 17:40:53 GMT
35
33
  X-Powered-By:
36
34
  - Express
35
+ X-Ratelimit-Bucket:
36
+ - bearer
37
+ X-Ratelimit-Limit:
38
+ - '1200'
39
+ X-Ratelimit-Remaining:
40
+ - '1184'
41
+ X-Ratelimit-Reset:
42
+ - '1443289303'
37
43
  Content-Length:
38
44
  - '68'
39
45
  Connection:
40
46
  - keep-alive
41
47
  body:
42
- encoding: US-ASCII
43
- string: ! '{"count":7,"links":[{"rel":"self","uri":"/v1.1/events?count=true"}]}'
48
+ encoding: UTF-8
49
+ string: '{"count":7,"links":[{"rel":"self","uri":"/v1.1/events?count=true"}]}'
44
50
  http_version:
45
- recorded_at: Sat, 13 Sep 2014 00:05:05 GMT
51
+ recorded_at: Sat, 26 Sep 2015 17:40:53 GMT
46
52
  recorded_with: VCR 2.9.3
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.clever.com/v1.1/school_admins?count=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Authorization:
15
+ - Bearer DEMO_TOKEN
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Access-Control-Allow-Headers:
24
+ - Content-Type,Authorization,X-Requested-With,Accept,Origin,Referer,User-Agent
25
+ Access-Control-Allow-Methods:
26
+ - GET,PATCH,POST,DELETE
27
+ Access-Control-Allow-Origin:
28
+ - "*"
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Date:
32
+ - Sat, 26 Sep 2015 17:41:03 GMT
33
+ X-Powered-By:
34
+ - Express
35
+ X-Ratelimit-Bucket:
36
+ - bearer
37
+ X-Ratelimit-Limit:
38
+ - '1200'
39
+ X-Ratelimit-Remaining:
40
+ - '1157'
41
+ X-Ratelimit-Reset:
42
+ - '1443289303'
43
+ Content-Length:
44
+ - '75'
45
+ Connection:
46
+ - keep-alive
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"count":1,"links":[{"rel":"self","uri":"/v1.1/school_admins?count=true"}]}'
50
+ http_version:
51
+ recorded_at: Sat, 26 Sep 2015 17:41:03 GMT
52
+ recorded_with: VCR 2.9.3