bearcat 1.0.15 → 1.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8118abcd2814127909a8a55240160b066e5f2b3a
4
- data.tar.gz: ce827deeaee4b821fe3c5c5f22e4222d5b16bf6a
3
+ metadata.gz: 0d829191bf6ddaa196f493fe2d919f47a8f6e43a
4
+ data.tar.gz: 0f604717a3b5afa1a868dcdebf430675dd44fa1d
5
5
  SHA512:
6
- metadata.gz: 7b7950bf8399b5ca89e338ea1e35756af56076658e50d2bd38f050eb2d2782acb7780dbe73ac8873128fc217264f756b0549973fa95d6ed0abacf5683b11b7e4
7
- data.tar.gz: 4c8c79251d7dd11adc151f7cb7fcefd086c858cc5224e2c420663d57a131070b3334aaaabc86ec05ac4b6b12f58ee0e0a4d6da753ee886acf77aeb4a1d198c8c
6
+ metadata.gz: 5408023839d39f64a5895d3575f2299a2ee46d4e51c86087f6b521d4b4e69d1205732799701fa216200f83c7d3ea979cd71dc4bfd92b912c93ca48478b2485e1
7
+ data.tar.gz: 6085b3a29a40d24d52e5da5469101bb978d606b9ea1edd44a1656306597aa2cf5eb778f0e5d01dfed6a82ebd13e4cd22d45b779926adab957c7da1560a24fc1e
@@ -25,6 +25,7 @@ module Bearcat
25
25
  require 'bearcat/client/search'
26
26
  require 'bearcat/client/quizzes'
27
27
  require 'bearcat/client/assignment_groups'
28
+ require 'bearcat/client/pages'
28
29
 
29
30
  include Assignments
30
31
  include Accounts
@@ -49,6 +50,7 @@ module Bearcat
49
50
  include Search
50
51
  include Quizzes
51
52
  include AssignmentGroups
53
+ include Pages
52
54
 
53
55
 
54
56
  # Override Footrest request for ApiArray support
@@ -0,0 +1,11 @@
1
+ module Bearcat
2
+ class Client < Footrest::Client
3
+ module Pages
4
+
5
+ def list_course_pages(course, params={})
6
+ get("/api/v1/courses/#{course}/pages", params)
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.0.15' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.0.16' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -0,0 +1,17 @@
1
+ require 'helper'
2
+
3
+ describe Bearcat::Client::Pages do
4
+ before do
5
+ @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token")
6
+ end
7
+
8
+ it "returns a courses pages" do
9
+ stub_get(@client, "/api/v1/courses/1/pages").to_return(json_response("pages.json"))
10
+ pages = @client.list_course_pages('1')
11
+ pages.class.should eq(Bearcat::ApiArray)
12
+ pages.count.should == 2
13
+ pages.first['page_id'].should == 1
14
+ pages.last['page_id'].should == 2
15
+ end
16
+
17
+ end
@@ -0,0 +1,40 @@
1
+ [
2
+ {
3
+ "created_at": "2015-05-20T19:07:44Z",
4
+ "editing_roles": "teachers",
5
+ "title": "Instruction Test",
6
+ "updated_at": "2015-05-20T19:08:13Z",
7
+ "url": "instruction-test",
8
+ "page_id": 1,
9
+ "last_edited_by": {
10
+ "id": 1,
11
+ "display_name": "ctanner@instructure.com",
12
+ "avatar_image_url": "https://canvas.instructure.com/images/messages/avatar-50.png",
13
+ "html_url": "http://localhost:3000/courses/1/users/1"
14
+ },
15
+ "published": true,
16
+ "hide_from_students": false,
17
+ "front_page": false,
18
+ "html_url": "http://localhost:3000/courses/1/pages/instruction-test",
19
+ "locked_for_user": false
20
+ },
21
+ {
22
+ "created_at": "2015-05-20T19:14:04Z",
23
+ "editing_roles": "teachers",
24
+ "title": "Blah Page",
25
+ "updated_at": "2015-05-20T19:14:04Z",
26
+ "url": "blah-page",
27
+ "page_id": 2,
28
+ "last_edited_by": {
29
+ "id": 1,
30
+ "display_name": "ctanner@instructure.com",
31
+ "avatar_image_url": "https://canvas.instructure.com/images/messages/avatar-50.png",
32
+ "html_url": "http://localhost:3000/courses/1/users/1"
33
+ },
34
+ "published": true,
35
+ "hide_from_students": false,
36
+ "front_page": false,
37
+ "html_url": "http://localhost:3000/courses/1/pages/blah-page",
38
+ "locked_for_user": false
39
+ }
40
+ ]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bearcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Mills, Jake Sorce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-19 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -124,6 +124,7 @@ files:
124
124
  - lib/bearcat/client/o_auth2.rb
125
125
  - lib/bearcat/client/outcome_groups.rb
126
126
  - lib/bearcat/client/outcomes.rb
127
+ - lib/bearcat/client/pages.rb
127
128
  - lib/bearcat/client/quizzes.rb
128
129
  - lib/bearcat/client/reports.rb
129
130
  - lib/bearcat/client/search.rb
@@ -146,6 +147,7 @@ files:
146
147
  - spec/bearcat/client/o_auth2_spec.rb
147
148
  - spec/bearcat/client/outcome_groups_spec.rb
148
149
  - spec/bearcat/client/outcomes_spec.rb
150
+ - spec/bearcat/client/pages_spec.rb
149
151
  - spec/bearcat/client/quizzes_spec.rb
150
152
  - spec/bearcat/client/reports_spec.rb
151
153
  - spec/bearcat/client/search_spec.rb
@@ -209,6 +211,7 @@ files:
209
211
  - spec/fixtures/outcome_subgroups.json
210
212
  - spec/fixtures/outcomes.json
211
213
  - spec/fixtures/paged_body.json
214
+ - spec/fixtures/pages.json
212
215
  - spec/fixtures/quizzes/course_quiz.json
213
216
  - spec/fixtures/quizzes/course_quizzes.json
214
217
  - spec/fixtures/quizzes/quiz_extension.json
@@ -270,6 +273,7 @@ test_files:
270
273
  - spec/bearcat/client/o_auth2_spec.rb
271
274
  - spec/bearcat/client/outcome_groups_spec.rb
272
275
  - spec/bearcat/client/outcomes_spec.rb
276
+ - spec/bearcat/client/pages_spec.rb
273
277
  - spec/bearcat/client/quizzes_spec.rb
274
278
  - spec/bearcat/client/reports_spec.rb
275
279
  - spec/bearcat/client/search_spec.rb
@@ -333,6 +337,7 @@ test_files:
333
337
  - spec/fixtures/outcome_subgroups.json
334
338
  - spec/fixtures/outcomes.json
335
339
  - spec/fixtures/paged_body.json
340
+ - spec/fixtures/pages.json
336
341
  - spec/fixtures/quizzes/course_quiz.json
337
342
  - spec/fixtures/quizzes/course_quizzes.json
338
343
  - spec/fixtures/quizzes/quiz_extension.json