bearcat 1.3.38 → 1.3.39

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
  SHA256:
3
- metadata.gz: 20f86027d22541084d7e8e2d48814c49693d66f04359584c0042597afd8c69d7
4
- data.tar.gz: 147edd38908625ec094e2d9037e7c07bbe02f545c9322c690bdff4b677e9e2a5
3
+ metadata.gz: 65123eeb33d4e34d269eb78e2dd2bbb24a3b0dd22ea8669a0aad71d95fcdd579
4
+ data.tar.gz: 27d69431eb95003df4f38413b12de69d797d5b1d1f55a1d2bc06f82a199bf229
5
5
  SHA512:
6
- metadata.gz: bb57921aa5cfb4194305906e70c86ce0d6cd7eb50921dc4f19f53f8bea85483b975ab21202b6afc7992c28528f343623c685b9b3cd39cfe2a2a72557cfff7780
7
- data.tar.gz: 5fae4bf3faa2dbf8d6ff786fb8c3e8c1099cb46473a7a22cf5eacd5f3da4da9fe050bfd42c14675083e23505ff9847aa4f041a63ebc82e0c0d9d1a33a9b15616
6
+ metadata.gz: 8826c81214be7c758f4f3c847407d9b2f926cfaabbcb8ae086108d4aa647dce1a9a6fb9d415dd0ff4982e9f484c7daa57d418fec1c03cc6ca12bd151cdd640ae
7
+ data.tar.gz: abc239a8e4211ff6da3af47a56e98a83385a8ca8cbc0ee17b39cbe8f6a4df8dfca72fddfd2e576313ffffd25d669ffa4b481f75886ab563245b9df5838bbf132
@@ -14,6 +14,10 @@ module Bearcat
14
14
  get("/api/v1/courses/#{course_id}/modules/#{context_module_id}", params)
15
15
  end
16
16
 
17
+ def create_module(course, params={})
18
+ post("/api/v1/courses/#{course}/modules", params)
19
+ end
20
+
17
21
  end
18
22
  end
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.3.38' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.3.39' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -28,5 +28,16 @@ describe Bearcat::Client::Modules do
28
28
  expect(context_module['id']).to eq(2)
29
29
  end
30
30
  end
31
- end
32
31
 
32
+ describe "#create_module" do
33
+ it "creates a new module" do
34
+ name = "new module"
35
+ stub_request(:post, "http://canvas.instructure.com/api/v1/courses/1/modules")
36
+ .with(body: {"name"=>"new module"})
37
+ .to_return(json_response("created_module.json"))
38
+ course_module = @client.create_module(1, { name: name })
39
+ course_module["name"].should == name
40
+ course_module["id"].should == 1
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": 1,
3
+ "name": "new module",
4
+ "position": 1,
5
+ "unlock_at": null,
6
+ "require_sequential_progress": true,
7
+ "publish_final_grade": false,
8
+ "prerequisite_module_ids": [],
9
+ "state": "active",
10
+ "completed_at": "2014-04-18T19:38:01Z",
11
+ "items_count": 0,
12
+ "items_url": "http://localhost:3000/api/v1/courses/1384/modules/1/items"
13
+ }
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.38
4
+ version: 1.3.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Mills, Jake Sorce
@@ -270,6 +270,7 @@ files:
270
270
  - spec/fixtures/created_group.json
271
271
  - spec/fixtures/created_group_category.json
272
272
  - spec/fixtures/created_group_membership.json
273
+ - spec/fixtures/created_module.json
273
274
  - spec/fixtures/custom_data.json
274
275
  - spec/fixtures/custom_food_data.json
275
276
  - spec/fixtures/custom_gradebook_columns/column_data.json
@@ -499,6 +500,7 @@ test_files:
499
500
  - spec/fixtures/user_profile.json
500
501
  - spec/fixtures/create_course_discussion.json
501
502
  - spec/fixtures/custom_food_data.json
503
+ - spec/fixtures/created_module.json
502
504
  - spec/fixtures/course_groups.json
503
505
  - spec/fixtures/reactivate_enrollment.json
504
506
  - spec/fixtures/account_courses.json