bearcat 1.3.21 → 1.3.22
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/module_items.rb +5 -1
- data/lib/bearcat/client/modules.rb +5 -1
- data/lib/bearcat/version.rb +1 -1
- data/spec/bearcat/client/module_items_spec.rb +9 -1
- data/spec/bearcat/client/modules_spec.rb +9 -1
- data/spec/fixtures/module.json +15 -0
- data/spec/fixtures/module_item.json +15 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b95690f2e8748eaf87696b6bcd4d578d73d5058
|
4
|
+
data.tar.gz: 1205db10c3ad4f47be63dbe7949d7d7111d470cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 025f100cd61306e6c7fc8b1d5e0272f4c0cafd570a09be0d70e684ccf774bc4fa3158b5db231a4e493b21cb02e301817530740e68fc3e4ef1c7fc0f6d7660545
|
7
|
+
data.tar.gz: e9a699468d7006b9272a0291b793f93fb0b503a62b40f5c89ac51bee1da313a2928d121359a1d764a441166e7c4175e7bef0c3bcc6cf19d92f89cac2d1215386
|
@@ -6,6 +6,10 @@ module Bearcat
|
|
6
6
|
get("/api/v1/courses/#{course}/modules/#{mod}/items", params)
|
7
7
|
end
|
8
8
|
|
9
|
+
def module_item(course_id, module_id, module_item_id, params = {})
|
10
|
+
get("/api/v1/courses/#{course_id}/modules/#{module_id}/items/#{module_item_id}", params)
|
11
|
+
end
|
12
|
+
|
9
13
|
end
|
10
14
|
end
|
11
|
-
end
|
15
|
+
end
|
@@ -10,6 +10,10 @@ module Bearcat
|
|
10
10
|
get("/api/v1/courses/#{course}/module_item_sequence", params)
|
11
11
|
end
|
12
12
|
|
13
|
+
def course_module(course_id, context_module_id, params={})
|
14
|
+
get("/api/v1/courses/#{course_id}/modules/#{context_module_id}", params)
|
15
|
+
end
|
16
|
+
|
13
17
|
end
|
14
18
|
end
|
15
|
-
end
|
19
|
+
end
|
data/lib/bearcat/version.rb
CHANGED
@@ -13,4 +13,12 @@ describe Bearcat::Client::ModuleItems do
|
|
13
13
|
items.members[0]['type'].should == 'Page'
|
14
14
|
end
|
15
15
|
|
16
|
-
|
16
|
+
describe '#module_item' do
|
17
|
+
it 'returns a module' do
|
18
|
+
stub_get(@client, '/api/v1/courses/1/modules/1/items/2').to_return(json_response('module_item.json'))
|
19
|
+
item = @client.module_item(1, 1, 2)
|
20
|
+
expect(item['id']).to eq(2)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -21,4 +21,12 @@ describe Bearcat::Client::Modules do
|
|
21
21
|
items.last["id"].should == 3
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
describe "#course_module" do
|
25
|
+
it "returns a course module" do
|
26
|
+
stub_get(@client, "/api/v1/courses/1/modules/2").to_return(json_response("module.json"))
|
27
|
+
context_module = @client.course_module(1, 2)
|
28
|
+
expect(context_module['id']).to eq(2)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"id": 2,
|
3
|
+
"name": "Second Module",
|
4
|
+
"position": 2,
|
5
|
+
"unlock_at": null,
|
6
|
+
"require_sequential_progress": true,
|
7
|
+
"publish_final_grade": false,
|
8
|
+
"prerequisite_module_ids": [
|
9
|
+
1
|
10
|
+
],
|
11
|
+
"state": "completed",
|
12
|
+
"completed_at": "2014-04-18T19:38:01Z",
|
13
|
+
"items_count": 1,
|
14
|
+
"items_url": "http://localhost:3000/api/v1/courses/1384/modules/2/items"
|
15
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"id": 2,
|
3
|
+
"indent": 0,
|
4
|
+
"position": 1,
|
5
|
+
"title": "Test Page",
|
6
|
+
"type": "Page",
|
7
|
+
"module_id": 1,
|
8
|
+
"html_url": "https://fakedomain.instructure.com/courses/1036/modules/items/1358",
|
9
|
+
"page_url": "1-dot-1-intro-to-disease",
|
10
|
+
"url": "https://fakedomain.instructure.com/api/v1/courses/1036/pages/1-dot-1-intro-to-disease",
|
11
|
+
"completion_requirement": {
|
12
|
+
"type": "must_view"
|
13
|
+
},
|
14
|
+
"published": true
|
15
|
+
}
|
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.3.
|
4
|
+
version: 1.3.22
|
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: 2018-
|
11
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -262,6 +262,8 @@ files:
|
|
262
262
|
- spec/fixtures/group_membership.json
|
263
263
|
- spec/fixtures/link_unlink_outcome.json
|
264
264
|
- spec/fixtures/merge_user.json
|
265
|
+
- spec/fixtures/module.json
|
266
|
+
- spec/fixtures/module_item.json
|
265
267
|
- spec/fixtures/module_item_sequence.json
|
266
268
|
- spec/fixtures/module_items.json
|
267
269
|
- spec/fixtures/modules.json
|
@@ -447,6 +449,8 @@ test_files:
|
|
447
449
|
- spec/fixtures/group_membership.json
|
448
450
|
- spec/fixtures/link_unlink_outcome.json
|
449
451
|
- spec/fixtures/merge_user.json
|
452
|
+
- spec/fixtures/module.json
|
453
|
+
- spec/fixtures/module_item.json
|
450
454
|
- spec/fixtures/module_item_sequence.json
|
451
455
|
- spec/fixtures/module_items.json
|
452
456
|
- spec/fixtures/modules.json
|