canvas_sync 0.3.22 → 0.3.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/lib/canvas_sync.rb +61 -11
  4. data/lib/canvas_sync/generators/templates/models/assignment.rb +2 -0
  5. data/lib/canvas_sync/generators/templates/models/context_module.rb +10 -0
  6. data/lib/canvas_sync/generators/templates/models/context_module_item.rb +6 -0
  7. data/lib/canvas_sync/generators/templates/models/create_context_module_items.rb +19 -0
  8. data/lib/canvas_sync/generators/templates/models/create_context_modules.rb +20 -0
  9. data/lib/canvas_sync/jobs/sync_context_module_items_job.rb +28 -0
  10. data/lib/canvas_sync/jobs/sync_context_modules_job.rb +28 -0
  11. data/lib/canvas_sync/processors/context_module_items_processor.rb +24 -0
  12. data/lib/canvas_sync/processors/context_modules_processor.rb +24 -0
  13. data/lib/canvas_sync/processors/model_mappings.yml +47 -0
  14. data/lib/canvas_sync/version.rb +1 -1
  15. data/spec/canvas_sync/canvas_sync_spec.rb +3 -3
  16. data/spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb +29 -0
  17. data/spec/canvas_sync/jobs/sync_context_modules_job_spec.rb +29 -0
  18. data/spec/canvas_sync/models/assignment_spec.rb +9 -0
  19. data/spec/canvas_sync/models/context_module_item_spec.rb +10 -0
  20. data/spec/canvas_sync/models/context_module_spec.rb +19 -0
  21. data/spec/canvas_sync/processors/context_module_items_processor_spec.rb +13 -0
  22. data/spec/canvas_sync/processors/context_modules_processor_spec.rb +13 -0
  23. data/spec/dummy/app/models/assignment.rb +2 -0
  24. data/spec/dummy/app/models/context_module.rb +16 -0
  25. data/spec/dummy/app/models/context_module_item.rb +12 -0
  26. data/spec/dummy/db/migrate/20180411215348_create_context_modules.rb +26 -0
  27. data/spec/dummy/db/migrate/20180411215633_create_context_module_items.rb +25 -0
  28. data/spec/dummy/db/schema.rb +29 -1
  29. data/spec/dummy/log/development.log +1195 -0
  30. data/spec/dummy/log/test.log +8076 -0
  31. data/spec/factories/context_module_factory.rb +8 -0
  32. data/spec/factories/context_module_item_factory.rb +7 -0
  33. data/spec/spec_helper.rb +2 -0
  34. data/spec/support/fixtures/reports/context_module_items.csv +3 -0
  35. data/spec/support/fixtures/reports/context_modules.csv +3 -0
  36. metadata +38 -2
@@ -0,0 +1,8 @@
1
+ FactoryGirl.define do
2
+ factory :context_module do
3
+ sequence(:canvas_context_module_id) { |n| n }
4
+ name "Context Module"
5
+ workflow_state "available"
6
+ canvas_context { FactoryGirl.create(:course) }
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ FactoryGirl.define do
2
+ factory :context_module_item do
3
+ sequence(:canvas_context_module_item_id) { |n| n }
4
+ assignment
5
+ workflow_state "active"
6
+ end
7
+ end
data/spec/spec_helper.rb CHANGED
@@ -9,6 +9,8 @@ require 'timecop'
9
9
  require 'webmock/rspec'
10
10
  require 'support/fake_canvas'
11
11
  require 'shoulda/matchers'
12
+ require 'pry'
13
+ require 'pry-nav'
12
14
 
13
15
  ActiveRecord::Migration.maintain_test_schema!
14
16
 
@@ -0,0 +1,3 @@
1
+ canvas_context_module_item_id,content_id,content_type,context_id,context_type,context_module_id,position,workflow_state
2
+ 15,83,Assignment,16,Course,9,1,active
3
+ 16,80,Assignment,48,Course,10,1,active
@@ -0,0 +1,3 @@
1
+ canvas_context_module_id,canvas_context_id,canvas_context_type,name,position,workflow_state,deleted_at,unlock_at,migration_id,require_sequential_progress,requirement_count
2
+ 23,785,Course,New Mod,1,active,,,,false,
3
+ 4,27,Course,Modules gonna module,1,unpublished,,,,false,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.22
4
+ version: 0.3.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Collings
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-05 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -311,11 +311,15 @@ files:
311
311
  - lib/canvas_sync/generators/templates/models/admin.rb
312
312
  - lib/canvas_sync/generators/templates/models/assignment.rb
313
313
  - lib/canvas_sync/generators/templates/models/assignment_group.rb
314
+ - lib/canvas_sync/generators/templates/models/context_module.rb
315
+ - lib/canvas_sync/generators/templates/models/context_module_item.rb
314
316
  - lib/canvas_sync/generators/templates/models/course.rb
315
317
  - lib/canvas_sync/generators/templates/models/create_accounts.rb
316
318
  - lib/canvas_sync/generators/templates/models/create_admins.rb
317
319
  - lib/canvas_sync/generators/templates/models/create_assignment_groups.rb
318
320
  - lib/canvas_sync/generators/templates/models/create_assignments.rb
321
+ - lib/canvas_sync/generators/templates/models/create_context_module_items.rb
322
+ - lib/canvas_sync/generators/templates/models/create_context_modules.rb
319
323
  - lib/canvas_sync/generators/templates/models/create_courses.rb
320
324
  - lib/canvas_sync/generators/templates/models/create_enrollments.rb
321
325
  - lib/canvas_sync/generators/templates/models/create_roles.rb
@@ -358,6 +362,8 @@ files:
358
362
  - lib/canvas_sync/jobs/sync_admins_job.rb
359
363
  - lib/canvas_sync/jobs/sync_assignment_groups_job.rb
360
364
  - lib/canvas_sync/jobs/sync_assignments_job.rb
365
+ - lib/canvas_sync/jobs/sync_context_module_items_job.rb
366
+ - lib/canvas_sync/jobs/sync_context_modules_job.rb
361
367
  - lib/canvas_sync/jobs/sync_provisioning_report_job.rb
362
368
  - lib/canvas_sync/jobs/sync_roles_job.rb
363
369
  - lib/canvas_sync/jobs/sync_submissions_job.rb
@@ -365,6 +371,8 @@ files:
365
371
  - lib/canvas_sync/jobs/sync_users_job.rb
366
372
  - lib/canvas_sync/processors/assignment_groups_processor.rb
367
373
  - lib/canvas_sync/processors/assignments_processor.rb
374
+ - lib/canvas_sync/processors/context_module_items_processor.rb
375
+ - lib/canvas_sync/processors/context_modules_processor.rb
368
376
  - lib/canvas_sync/processors/model_mappings.yml
369
377
  - lib/canvas_sync/processors/provisioning_report_processor.rb
370
378
  - lib/canvas_sync/processors/report_processor.rb
@@ -378,6 +386,8 @@ files:
378
386
  - spec/canvas_sync/jobs/sync_admins_job_spec.rb
379
387
  - spec/canvas_sync/jobs/sync_assignment_groups_job_spec.rb
380
388
  - spec/canvas_sync/jobs/sync_assignments_job_spec.rb
389
+ - spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
390
+ - spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
381
391
  - spec/canvas_sync/jobs/sync_provisioning_report_job_spec.rb
382
392
  - spec/canvas_sync/jobs/sync_roles_job_spec.rb
383
393
  - spec/canvas_sync/jobs/sync_submissions_job_spec.rb
@@ -387,6 +397,8 @@ files:
387
397
  - spec/canvas_sync/models/admins_spec.rb
388
398
  - spec/canvas_sync/models/assignment_group_spec.rb
389
399
  - spec/canvas_sync/models/assignment_spec.rb
400
+ - spec/canvas_sync/models/context_module_item_spec.rb
401
+ - spec/canvas_sync/models/context_module_spec.rb
390
402
  - spec/canvas_sync/models/course_spec.rb
391
403
  - spec/canvas_sync/models/enrollment_spec.rb
392
404
  - spec/canvas_sync/models/roles_spec.rb
@@ -396,6 +408,8 @@ files:
396
408
  - spec/canvas_sync/models/user_spec.rb
397
409
  - spec/canvas_sync/processors/assignment_groups_processor_spec.rb
398
410
  - spec/canvas_sync/processors/assignments_processor_spec.rb
411
+ - spec/canvas_sync/processors/context_module_items_processor_spec.rb
412
+ - spec/canvas_sync/processors/context_modules_processor_spec.rb
399
413
  - spec/canvas_sync/processors/provisioning_report_processor_spec.rb
400
414
  - spec/canvas_sync/processors/submissions_processor_spec.rb
401
415
  - spec/dummy/README.rdoc
@@ -405,6 +419,8 @@ files:
405
419
  - spec/dummy/app/models/application_record.rb
406
420
  - spec/dummy/app/models/assignment.rb
407
421
  - spec/dummy/app/models/assignment_group.rb
422
+ - spec/dummy/app/models/context_module.rb
423
+ - spec/dummy/app/models/context_module_item.rb
408
424
  - spec/dummy/app/models/course.rb
409
425
  - spec/dummy/app/models/enrollment.rb
410
426
  - spec/dummy/app/models/role.rb
@@ -437,6 +453,8 @@ files:
437
453
  - spec/dummy/db/migrate/20180216171618_create_submissions.rb
438
454
  - spec/dummy/db/migrate/20180220172559_create_accounts.rb
439
455
  - spec/dummy/db/migrate/20180222163506_create_assignment_groups.rb
456
+ - spec/dummy/db/migrate/20180411215348_create_context_modules.rb
457
+ - spec/dummy/db/migrate/20180411215633_create_context_module_items.rb
440
458
  - spec/dummy/db/schema.rb
441
459
  - spec/dummy/db/test.sqlite3
442
460
  - spec/dummy/log/development.log
@@ -445,6 +463,8 @@ files:
445
463
  - spec/factories/admin_factory.rb
446
464
  - spec/factories/assignment_factory.rb
447
465
  - spec/factories/assignment_group_factory.rb
466
+ - spec/factories/context_module_factory.rb
467
+ - spec/factories/context_module_item_factory.rb
448
468
  - spec/factories/course_factory.rb
449
469
  - spec/factories/enrollment_factory.rb
450
470
  - spec/factories/role_factory.rb
@@ -459,6 +479,8 @@ files:
459
479
  - spec/support/fixtures/canvas_responses/terms.json
460
480
  - spec/support/fixtures/reports/assignment_groups.csv
461
481
  - spec/support/fixtures/reports/assignments.csv
482
+ - spec/support/fixtures/reports/context_module_items.csv
483
+ - spec/support/fixtures/reports/context_modules.csv
462
484
  - spec/support/fixtures/reports/courses.csv
463
485
  - spec/support/fixtures/reports/enrollments.csv
464
486
  - spec/support/fixtures/reports/provisioning_csv
@@ -500,6 +522,8 @@ test_files:
500
522
  - spec/canvas_sync/jobs/sync_admins_job_spec.rb
501
523
  - spec/canvas_sync/jobs/sync_assignment_groups_job_spec.rb
502
524
  - spec/canvas_sync/jobs/sync_assignments_job_spec.rb
525
+ - spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
526
+ - spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
503
527
  - spec/canvas_sync/jobs/sync_provisioning_report_job_spec.rb
504
528
  - spec/canvas_sync/jobs/sync_roles_job_spec.rb
505
529
  - spec/canvas_sync/jobs/sync_submissions_job_spec.rb
@@ -509,6 +533,8 @@ test_files:
509
533
  - spec/canvas_sync/models/admins_spec.rb
510
534
  - spec/canvas_sync/models/assignment_group_spec.rb
511
535
  - spec/canvas_sync/models/assignment_spec.rb
536
+ - spec/canvas_sync/models/context_module_item_spec.rb
537
+ - spec/canvas_sync/models/context_module_spec.rb
512
538
  - spec/canvas_sync/models/course_spec.rb
513
539
  - spec/canvas_sync/models/enrollment_spec.rb
514
540
  - spec/canvas_sync/models/roles_spec.rb
@@ -518,6 +544,8 @@ test_files:
518
544
  - spec/canvas_sync/models/user_spec.rb
519
545
  - spec/canvas_sync/processors/assignment_groups_processor_spec.rb
520
546
  - spec/canvas_sync/processors/assignments_processor_spec.rb
547
+ - spec/canvas_sync/processors/context_module_items_processor_spec.rb
548
+ - spec/canvas_sync/processors/context_modules_processor_spec.rb
521
549
  - spec/canvas_sync/processors/provisioning_report_processor_spec.rb
522
550
  - spec/canvas_sync/processors/submissions_processor_spec.rb
523
551
  - spec/dummy/README.rdoc
@@ -527,6 +555,8 @@ test_files:
527
555
  - spec/dummy/app/models/application_record.rb
528
556
  - spec/dummy/app/models/assignment.rb
529
557
  - spec/dummy/app/models/assignment_group.rb
558
+ - spec/dummy/app/models/context_module.rb
559
+ - spec/dummy/app/models/context_module_item.rb
530
560
  - spec/dummy/app/models/course.rb
531
561
  - spec/dummy/app/models/enrollment.rb
532
562
  - spec/dummy/app/models/role.rb
@@ -559,6 +589,8 @@ test_files:
559
589
  - spec/dummy/db/migrate/20180216171618_create_submissions.rb
560
590
  - spec/dummy/db/migrate/20180220172559_create_accounts.rb
561
591
  - spec/dummy/db/migrate/20180222163506_create_assignment_groups.rb
592
+ - spec/dummy/db/migrate/20180411215348_create_context_modules.rb
593
+ - spec/dummy/db/migrate/20180411215633_create_context_module_items.rb
562
594
  - spec/dummy/db/schema.rb
563
595
  - spec/dummy/db/test.sqlite3
564
596
  - spec/dummy/log/development.log
@@ -567,6 +599,8 @@ test_files:
567
599
  - spec/factories/admin_factory.rb
568
600
  - spec/factories/assignment_factory.rb
569
601
  - spec/factories/assignment_group_factory.rb
602
+ - spec/factories/context_module_factory.rb
603
+ - spec/factories/context_module_item_factory.rb
570
604
  - spec/factories/course_factory.rb
571
605
  - spec/factories/enrollment_factory.rb
572
606
  - spec/factories/role_factory.rb
@@ -581,6 +615,8 @@ test_files:
581
615
  - spec/support/fixtures/canvas_responses/terms.json
582
616
  - spec/support/fixtures/reports/assignment_groups.csv
583
617
  - spec/support/fixtures/reports/assignments.csv
618
+ - spec/support/fixtures/reports/context_module_items.csv
619
+ - spec/support/fixtures/reports/context_modules.csv
584
620
  - spec/support/fixtures/reports/courses.csv
585
621
  - spec/support/fixtures/reports/enrollments.csv
586
622
  - spec/support/fixtures/reports/provisioning_csv