bearcat 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bearcat/client.rb +0 -2
- data/lib/bearcat/client/courses.rb +4 -0
- data/lib/bearcat/client/quizzes.rb +2 -2
- data/lib/bearcat/version.rb +1 -1
- data/spec/bearcat/client/accounts_spec.rb +3 -5
- data/spec/bearcat/client/courses_spec.rb +7 -0
- data/spec/bearcat/client/quizzes_spec.rb +2 -2
- data/spec/fixtures/enrollment_terms.json +1 -1
- metadata +20 -24
- data/lib/bearcat/client/search.rb +0 -11
- data/spec/bearcat/client/search_spec.rb +0 -16
- data/spec/fixtures/search_find_recipients.json +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 091f832ac71d9fae4f55ee7826ba6e841ba8d5a6
|
4
|
+
data.tar.gz: 21f33e25f39455eb1e992ee0f76cf3f3d4697f8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 073d68053af3a70c7514494bb3ec83631ffc4b7489f07c8dabde4f199aea84ac610fa389740778f6ca946c2edc271dd09e3e99d13abbcdd48deec6c6f66325ba
|
7
|
+
data.tar.gz: bbfb77ac851b2161eb0adfa39419e764c5d9eddf754291d75c8df9b6a1bd2e7adadb8447d0a61d6d03d82fc742e90b008d14db42ba70df7debe4b46c28f89304
|
data/lib/bearcat/client.rb
CHANGED
@@ -21,7 +21,6 @@ module Bearcat
|
|
21
21
|
require 'bearcat/client/canvas_files'
|
22
22
|
require 'bearcat/client/calendar_events'
|
23
23
|
require 'bearcat/client/discussions'
|
24
|
-
require 'bearcat/client/search'
|
25
24
|
require 'bearcat/client/quizzes'
|
26
25
|
|
27
26
|
include Assignments
|
@@ -43,7 +42,6 @@ module Bearcat
|
|
43
42
|
include CalendarEvents
|
44
43
|
include Discussions
|
45
44
|
include FileHelper
|
46
|
-
include Search
|
47
45
|
include Quizzes
|
48
46
|
|
49
47
|
|
@@ -18,6 +18,10 @@ module Bearcat
|
|
18
18
|
get("/api/v1/courses/#{course}/users", params)
|
19
19
|
end
|
20
20
|
|
21
|
+
def course_quiz_extensions(course, params={})
|
22
|
+
post("/api/v1/courses/#{course}/quiz_extensions", params)
|
23
|
+
end
|
24
|
+
|
21
25
|
def create_content_migration(course, file_path, params={})
|
22
26
|
response = post("/api/v1/courses/#{course}/content_migrations", params)
|
23
27
|
pre_attachment = response['pre_attachment']
|
@@ -10,8 +10,8 @@ module Bearcat
|
|
10
10
|
get("/api/v1/courses/#{course}/quizzes/#{quiz}", params)
|
11
11
|
end
|
12
12
|
|
13
|
-
def quiz_extensions(course, params={})
|
14
|
-
post("/api/v1/courses/#{course}/
|
13
|
+
def quiz_extensions(course, quiz, params={})
|
14
|
+
post("/api/v1/courses/#{course}/quizzes/#{quiz}/extensions", params)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
data/lib/bearcat/version.rb
CHANGED
@@ -14,11 +14,9 @@ describe Bearcat::Client::Accounts do
|
|
14
14
|
|
15
15
|
it "returns enrollment terms for an account" do
|
16
16
|
stub_get(@client, "/api/v1/accounts/1/terms").to_return(json_response("enrollment_terms.json"))
|
17
|
-
|
18
|
-
terms
|
19
|
-
terms.
|
20
|
-
terms.first['id'].should == 4
|
21
|
-
terms.first['name'].should == 'Term 1'
|
17
|
+
terms = @client.terms(1).first
|
18
|
+
terms['id'].should == 4
|
19
|
+
terms['name'].should == 'Term 1'
|
22
20
|
end
|
23
21
|
|
24
22
|
end
|
@@ -63,4 +63,11 @@ describe Bearcat::Client::Sections do
|
|
63
63
|
expect { @client.create_content_migration('659', fixture('cc.imscc'), opts) }.to raise_exception
|
64
64
|
end
|
65
65
|
|
66
|
+
it 'sets extensions on a quiz' do
|
67
|
+
stub_post(@client, "/api/v1/courses/1/quiz_extensions").to_return(json_response("quizzes/quiz_extension.json"))
|
68
|
+
quiz_extension = @client.course_quiz_extensions('1', {quiz_extensions: [{user_id: 1}, {extra_time: 30}]})
|
69
|
+
quiz_extension.class.should eq(Hash)
|
70
|
+
quiz_extension['quiz_extensions'].first['extra_time'].should eq(30)
|
71
|
+
end
|
72
|
+
|
66
73
|
end
|
@@ -22,8 +22,8 @@ describe Bearcat::Client::Quizzes do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'sets extensions on a quiz' do
|
25
|
-
stub_post(@client, "/api/v1/courses/1/
|
26
|
-
quiz_extension = @client.quiz_extensions('1', {quiz_extensions: [{user_id: 1}, {extra_time: 30}]})
|
25
|
+
stub_post(@client, "/api/v1/courses/1/quizzes/1/extensions").to_return(json_response("quizzes/quiz_extension.json"))
|
26
|
+
quiz_extension = @client.quiz_extensions('1', '1', {quiz_extensions: [{user_id: 1}, {extra_time: 30}]})
|
27
27
|
quiz_extension.class.should eq(Hash)
|
28
28
|
quiz_extension['quiz_extensions'].first['extra_time'].should eq(30)
|
29
29
|
end
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bearcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
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: 2014-10-
|
11
|
+
date: 2014-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.0.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '2.6'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.6'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: webmock
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: footrest
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 0.2.2
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.2.2
|
97
97
|
description: Ruby interface for interacting with the canvas API
|
@@ -103,9 +103,7 @@ extra_rdoc_files: []
|
|
103
103
|
files:
|
104
104
|
- Rakefile
|
105
105
|
- bearcat.gemspec
|
106
|
-
- lib/bearcat.rb
|
107
106
|
- lib/bearcat/api_array.rb
|
108
|
-
- lib/bearcat/client.rb
|
109
107
|
- lib/bearcat/client/account_reports.rb
|
110
108
|
- lib/bearcat/client/accounts.rb
|
111
109
|
- lib/bearcat/client/assignments.rb
|
@@ -124,11 +122,12 @@ files:
|
|
124
122
|
- lib/bearcat/client/outcomes.rb
|
125
123
|
- lib/bearcat/client/quizzes.rb
|
126
124
|
- lib/bearcat/client/reports.rb
|
127
|
-
- lib/bearcat/client/search.rb
|
128
125
|
- lib/bearcat/client/sections.rb
|
129
126
|
- lib/bearcat/client/submissions.rb
|
130
127
|
- lib/bearcat/client/users.rb
|
128
|
+
- lib/bearcat/client.rb
|
131
129
|
- lib/bearcat/version.rb
|
130
|
+
- lib/bearcat.rb
|
132
131
|
- spec/bearcat/client/accounts_spec.rb
|
133
132
|
- spec/bearcat/client/assignments_spec.rb
|
134
133
|
- spec/bearcat/client/calendar_events_spec.rb
|
@@ -145,7 +144,6 @@ files:
|
|
145
144
|
- spec/bearcat/client/outcomes_spec.rb
|
146
145
|
- spec/bearcat/client/quizzes_spec.rb
|
147
146
|
- spec/bearcat/client/reports_spec.rb
|
148
|
-
- spec/bearcat/client/search_spec.rb
|
149
147
|
- spec/bearcat/client/sections_spec.rb
|
150
148
|
- spec/bearcat/client/submissions_spec.rb
|
151
149
|
- spec/bearcat/client/users_spec.rb
|
@@ -206,7 +204,6 @@ files:
|
|
206
204
|
- spec/fixtures/report_history.json
|
207
205
|
- spec/fixtures/report_list.json
|
208
206
|
- spec/fixtures/report_status.json
|
209
|
-
- spec/fixtures/search_find_recipients.json
|
210
207
|
- spec/fixtures/section.json
|
211
208
|
- spec/fixtures/section_enrollments.json
|
212
209
|
- spec/fixtures/single_account.json
|
@@ -230,17 +227,17 @@ require_paths:
|
|
230
227
|
- lib
|
231
228
|
required_ruby_version: !ruby/object:Gem::Requirement
|
232
229
|
requirements:
|
233
|
-
- -
|
230
|
+
- - '>='
|
234
231
|
- !ruby/object:Gem::Version
|
235
232
|
version: '0'
|
236
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
234
|
requirements:
|
238
|
-
- -
|
235
|
+
- - '>='
|
239
236
|
- !ruby/object:Gem::Version
|
240
237
|
version: '0'
|
241
238
|
requirements: []
|
242
239
|
rubyforge_project:
|
243
|
-
rubygems_version: 2.
|
240
|
+
rubygems_version: 2.0.3
|
244
241
|
signing_key:
|
245
242
|
specification_version: 4
|
246
243
|
summary: Canvas API
|
@@ -261,7 +258,6 @@ test_files:
|
|
261
258
|
- spec/bearcat/client/outcomes_spec.rb
|
262
259
|
- spec/bearcat/client/quizzes_spec.rb
|
263
260
|
- spec/bearcat/client/reports_spec.rb
|
264
|
-
- spec/bearcat/client/search_spec.rb
|
265
261
|
- spec/bearcat/client/sections_spec.rb
|
266
262
|
- spec/bearcat/client/submissions_spec.rb
|
267
263
|
- spec/bearcat/client/users_spec.rb
|
@@ -322,7 +318,6 @@ test_files:
|
|
322
318
|
- spec/fixtures/report_history.json
|
323
319
|
- spec/fixtures/report_list.json
|
324
320
|
- spec/fixtures/report_status.json
|
325
|
-
- spec/fixtures/search_find_recipients.json
|
326
321
|
- spec/fixtures/section.json
|
327
322
|
- spec/fixtures/section_enrollments.json
|
328
323
|
- spec/fixtures/single_account.json
|
@@ -337,3 +332,4 @@ test_files:
|
|
337
332
|
- spec/fixtures/user_page_views.json
|
338
333
|
- spec/fixtures/user_profile.json
|
339
334
|
- spec/helper.rb
|
335
|
+
has_rdoc:
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'helper'
|
2
|
-
|
3
|
-
describe Bearcat::Client::Search do
|
4
|
-
before do
|
5
|
-
@client = Bearcat::Client.new(prefix:"http://canvas.instructure.com", token: "test_token")
|
6
|
-
end
|
7
|
-
|
8
|
-
it "returns search results for recipients" do
|
9
|
-
stub_get(@client, "/api/v1/conversations/find_recipients?search=test").to_return(json_response("search_find_recipients.json"))
|
10
|
-
results = @client.find_recipients(:search => 'test')
|
11
|
-
results.first['name'].should == 'Test'
|
12
|
-
results.first['id'].should == 9
|
13
|
-
end
|
14
|
-
|
15
|
-
|
16
|
-
end
|