bearcat 1.0.24 → 1.0.25

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
  SHA1:
3
- metadata.gz: 0e64f14373158a3c51b9c252c2a3ec11d4c09444
4
- data.tar.gz: 539409fcc684429da22dcf7c90e253583bf16fd4
3
+ metadata.gz: 0be30d2a3aea7f404217744efdb659ee10710575
4
+ data.tar.gz: c2b93afc3cb2b98378be7011b9c7d188b22b086b
5
5
  SHA512:
6
- metadata.gz: 8ec0604c13c13a0114f5950fa238ad23097e5e566d569b302644d97671a1f4b5869df975c5dce21394447a3b34b322d4ffdebc214dc68c421ed0422e657c4f76
7
- data.tar.gz: 68597dede4b368424af3b37d15ba3667948af00bbe4902ff68be607df8af544d2a6a70986291b090eace638570e2bc4e16e85e0ff16c8c50ab43527ab2b64ab5
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
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.0.24' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.0.25' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -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.24
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-08-18 00:00:00.000000000 Z
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.5
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