bearcat 1.3.36 → 1.3.37
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 +4 -4
- data/lib/bearcat/client.rb +2 -0
- data/lib/bearcat/client/graph_ql.rb +12 -0
- data/lib/bearcat/version.rb +1 -1
- data/spec/bearcat/client/graph_ql_spec.rb +35 -0
- data/spec/fixtures/graph_ql_scores.json +33 -0
- metadata +6 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f276685c4b57737d725263680f095756e05cedc3b690b1f6a680a4cedb610c7
|
4
|
+
data.tar.gz: 451bc4c22312b0802260bad468ece4e1c49660c0ef2cbf2c8a0cc22ee98eb4f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a10afbfd1d0718c1dd80e2af6cda6e3cc06d133db78ecc332724fe75fe6649b1f07964fa45f1bc7aa6dd5ee89eb9d760b2d988546bbb01d74762f5fb15d6134
|
7
|
+
data.tar.gz: ee0be0d8181e37c19753e82a5162c71adc76157285e3f4db72b093e0856dec456faeb0e257685881aa2aaa42907c41f8cc953efbe660844f7f4adaf20e8bcd93
|
data/lib/bearcat/client.rb
CHANGED
@@ -32,6 +32,7 @@ module Bearcat
|
|
32
32
|
require 'bearcat/client/pages'
|
33
33
|
require 'bearcat/client/files'
|
34
34
|
require 'bearcat/client/folders'
|
35
|
+
require 'bearcat/client/graph_ql'
|
35
36
|
require 'bearcat/client/analytics'
|
36
37
|
require 'bearcat/client/module_items'
|
37
38
|
require 'bearcat/client/content_migrations'
|
@@ -70,6 +71,7 @@ module Bearcat
|
|
70
71
|
include Pages
|
71
72
|
include Files
|
72
73
|
include Folders
|
74
|
+
include GraphQL
|
73
75
|
include ModuleItems
|
74
76
|
include ContentMigrations
|
75
77
|
include ContentExports
|
data/lib/bearcat/version.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
describe Bearcat::Client::GraphQL do
|
4
|
+
|
5
|
+
let(:url) { '/api/graphql' }
|
6
|
+
before do
|
7
|
+
@client = Bearcat::Client.new(prefix: 'http://canvas.instructure.com', token: 'test_token')
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'returns scores for an assignment group' do
|
11
|
+
query = {
|
12
|
+
query: "{
|
13
|
+
assignmentGroup(id: \"29\") {
|
14
|
+
id
|
15
|
+
name
|
16
|
+
gradesConnection {
|
17
|
+
nodes {
|
18
|
+
finalGrade
|
19
|
+
finalScore
|
20
|
+
enrollment{
|
21
|
+
_id
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}"
|
27
|
+
}
|
28
|
+
stub_post(@client, url).with(body: query).to_return(json_response('graph_ql_scores.json'))
|
29
|
+
res = @client.graphql_query(query)
|
30
|
+
res['data']['assignmentGroup']['gradesConnection']['nodes'].count.should eq 3
|
31
|
+
res['data']['assignmentGroup']['name'].should eq 'Assignments'
|
32
|
+
res['data']['assignmentGroup']['gradesConnection']['nodes'][0]['currentScore'].should eq 100
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"assignmentGroup": {
|
4
|
+
"id": "QXNzaWdubWVudEdyb3VwLTI5",
|
5
|
+
"name": "Assignments",
|
6
|
+
"gradesConnection": {
|
7
|
+
"nodes": [
|
8
|
+
{
|
9
|
+
"finalGrade": null,
|
10
|
+
"currentScore": 100,
|
11
|
+
"enrollment": {
|
12
|
+
"_id": "63"
|
13
|
+
}
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"finalGrade": null,
|
17
|
+
"currentScore": 50,
|
18
|
+
"enrollment": {
|
19
|
+
"_id": "62"
|
20
|
+
}
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"finalGrade": null,
|
24
|
+
"currentScore": null,
|
25
|
+
"enrollment": {
|
26
|
+
"_id": "64"
|
27
|
+
}
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bearcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Mills, Jake Sorce
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- lib/bearcat/client/file_helper.rb
|
154
154
|
- lib/bearcat/client/files.rb
|
155
155
|
- lib/bearcat/client/folders.rb
|
156
|
+
- lib/bearcat/client/graph_ql.rb
|
156
157
|
- lib/bearcat/client/group_categories.rb
|
157
158
|
- lib/bearcat/client/group_memberships.rb
|
158
159
|
- lib/bearcat/client/groups.rb
|
@@ -190,6 +191,7 @@ files:
|
|
190
191
|
- spec/bearcat/client/external_tools_spec.rb
|
191
192
|
- spec/bearcat/client/files_spec.rb
|
192
193
|
- spec/bearcat/client/folders_spec.rb
|
194
|
+
- spec/bearcat/client/graph_ql_spec.rb
|
193
195
|
- spec/bearcat/client/group_categories_spec.rb
|
194
196
|
- spec/bearcat/client/group_membership_spec.rb
|
195
197
|
- spec/bearcat/client/groups_spec.rb
|
@@ -294,6 +296,7 @@ files:
|
|
294
296
|
- spec/fixtures/external_tools.json
|
295
297
|
- spec/fixtures/file.csv
|
296
298
|
- spec/fixtures/gradebook_history.json
|
299
|
+
- spec/fixtures/graph_ql_scores.json
|
297
300
|
- spec/fixtures/group.json
|
298
301
|
- spec/fixtures/group_categories.json
|
299
302
|
- spec/fixtures/group_category.json
|
@@ -389,6 +392,7 @@ test_files:
|
|
389
392
|
- spec/bearcat/client/modules_spec.rb
|
390
393
|
- spec/bearcat/client/discussions_spec.rb
|
391
394
|
- spec/bearcat/client/files_spec.rb
|
395
|
+
- spec/bearcat/client/graph_ql_spec.rb
|
392
396
|
- spec/bearcat/client/group_categories_spec.rb
|
393
397
|
- spec/bearcat/client/rubric_assessment_spec.rb
|
394
398
|
- spec/bearcat/client/submissions_spec.rb
|
@@ -537,6 +541,7 @@ test_files:
|
|
537
541
|
- spec/fixtures/group_category_groups.json
|
538
542
|
- spec/fixtures/created_group_membership.json
|
539
543
|
- spec/fixtures/user_avatars.json
|
544
|
+
- spec/fixtures/graph_ql_scores.json
|
540
545
|
- spec/fixtures/custom_gradebook_columns/custom_gradebook_column.json
|
541
546
|
- spec/fixtures/custom_gradebook_columns/custom_gradebook_columns.json
|
542
547
|
- spec/fixtures/custom_gradebook_columns/column_data.json
|