canvas_sync 0.17.23.beta8 → 0.17.27.beta1

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,11 @@ RSpec.describe CanvasSync::Processors::ProvisioningReportProcessor do
10
10
  }.to change { User.count }.by(2)
11
11
  end
12
12
 
13
+ it 'uses a User row with a sis_id' do
14
+ subject.process('spec/support/fixtures/reports/users.csv', { models: ['users'] }, 1)
15
+ expect(User.find_by(canvas_id: 2).sis_id).to eq 'sis_id_2'
16
+ end
17
+
13
18
  it 'processes courses' do
14
19
  expect {
15
20
  subject.process('spec/support/fixtures/reports/courses.csv', { models: ['courses'] }, 1)
@@ -35,11 +40,18 @@ RSpec.describe CanvasSync::Processors::ProvisioningReportProcessor do
35
40
  end
36
41
 
37
42
  it 'processes xlist' do
43
+ subject.process('spec/support/fixtures/reports/sections.csv', { models: ['sections'] }, 1)
44
+ expect(Section.find_by(canvas_id: 2).name).to eq "Lame Section"
45
+
38
46
  subject.process('spec/support/fixtures/reports/xlist.csv', { models: ['xlist'] }, 1)
47
+
39
48
  expect(Section.where.not(canvas_nonxlist_course_id: nil).count).to eq 1
40
49
  cross_listed_section = Section.where.not(canvas_nonxlist_course_id: nil).first
41
50
  expect(cross_listed_section.canvas_id).to eq 2
42
- expect(cross_listed_section.canvas_nonxlist_course_id).to eq 2
51
+ expect(cross_listed_section.canvas_nonxlist_course_id).to eq 3
52
+
53
+ expect(cross_listed_section.canvas_course_id).to eq 2
54
+ expect(cross_listed_section.name).to eq "Lame Section"
43
55
  end
44
56
 
45
57
  it 'processes groups' do