bearcat 1.0.24 → 1.0.25
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/courses.rb +5 -0
- data/lib/bearcat/version.rb +1 -1
- data/spec/bearcat/client/courses_spec.rb +8 -0
- data/spec/fixtures/course_copy.json +18 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0be30d2a3aea7f404217744efdb659ee10710575
|
4
|
+
data.tar.gz: c2b93afc3cb2b98378be7011b9c7d188b22b086b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e088a7ab4f95b2fe9e64a216c53064d9771b0949bc9a5f42f00ede340ab75429a38480c2bc5e4615ddb3664836d2cf1f9c54c21b920699ab4d2c08f5d7b0f3bd
|
7
|
+
data.tar.gz: 4c2a91d4011e0840b1f5650b4946db14b6e35053231de511da292c01f20e3b46a486436992baac021c51531a49201731d0a4be3b668bcc9ec4f68852d472ef19
|
@@ -36,6 +36,11 @@ module Bearcat
|
|
36
36
|
confirmation_url = post_file(pre_attachment['upload_url'], pre_attachment['upload_params'], file_path)
|
37
37
|
confirm_file_upload(confirmation_url)
|
38
38
|
end
|
39
|
+
|
40
|
+
# Performs effectively the same operation as #create_content_migration, but without the need to specify a file to be uploaded
|
41
|
+
def copy_course(course, params = {})
|
42
|
+
post("/api/v1/courses/#{course}/content_migrations", params)
|
43
|
+
end
|
39
44
|
end
|
40
45
|
end
|
41
46
|
end
|
data/lib/bearcat/version.rb
CHANGED
@@ -88,4 +88,12 @@ describe Bearcat::Client::Sections do
|
|
88
88
|
expect(links['alignment']).to eq('assignment_1')
|
89
89
|
end
|
90
90
|
|
91
|
+
it 'performs a course copy' do
|
92
|
+
stub_post(@client, '/api/v1/courses/1/content_migrations').to_return(json_response("course_copy.json"))
|
93
|
+
response = @client.copy_course('1')
|
94
|
+
expect(response['id']).to eql 199
|
95
|
+
expect(response['migration_type']).to eql 'course_copy_importer'
|
96
|
+
expect(response['workflow_state']).to eql 'running'
|
97
|
+
end
|
98
|
+
|
91
99
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"finished_at": null,
|
3
|
+
"id": 199,
|
4
|
+
"migration_type": "course_copy_importer",
|
5
|
+
"started_at": null,
|
6
|
+
"user_id": 1,
|
7
|
+
"workflow_state": "running",
|
8
|
+
"created_at": "2015-09-11T13:27:42Z",
|
9
|
+
"migration_issues_url": "http://localhost:3000/api/v1/courses/128/content_migrations/199/migration_issues",
|
10
|
+
"migration_issues_count": 0,
|
11
|
+
"settings": {
|
12
|
+
"source_course_id": 2,
|
13
|
+
"source_course_name": "Course 2",
|
14
|
+
"source_course_html_url": "http://localhost:3000/courses/2"
|
15
|
+
},
|
16
|
+
"progress_url": "http://localhost:3000/api/v1/progress/200",
|
17
|
+
"migration_type_title": "Course Copy"
|
18
|
+
}
|
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.
|
4
|
+
version: 1.0.25
|
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-
|
11
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- spec/fixtures/conversation.json
|
192
192
|
- spec/fixtures/course.json
|
193
193
|
- spec/fixtures/course_conferences.json
|
194
|
+
- spec/fixtures/course_copy.json
|
194
195
|
- spec/fixtures/course_enrollments.json
|
195
196
|
- spec/fixtures/course_files.json
|
196
197
|
- spec/fixtures/course_folders.json
|
@@ -265,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
266
|
version: '0'
|
266
267
|
requirements: []
|
267
268
|
rubyforge_project:
|
268
|
-
rubygems_version: 2.4.
|
269
|
+
rubygems_version: 2.4.3
|
269
270
|
signing_key:
|
270
271
|
specification_version: 4
|
271
272
|
summary: Canvas API
|
@@ -326,6 +327,7 @@ test_files:
|
|
326
327
|
- spec/fixtures/conversation.json
|
327
328
|
- spec/fixtures/course.json
|
328
329
|
- spec/fixtures/course_conferences.json
|
330
|
+
- spec/fixtures/course_copy.json
|
329
331
|
- spec/fixtures/course_enrollments.json
|
330
332
|
- spec/fixtures/course_files.json
|
331
333
|
- spec/fixtures/course_folders.json
|