coalescing_panda 4.1.17 → 4.1.18
Sign up to get free protection for your applications and to get access to all the features.
@@ -9,6 +9,12 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
|
|
9
9
|
{"id"=>3, "name"=>"student2@test.com", "sortable_name"=>"student2@test.com", "short_name"=>"student2@test.com", "login_id"=>"student2@test.com"}
|
10
10
|
]}
|
11
11
|
|
12
|
+
let(:courses_response) {[
|
13
|
+
{"account_id"=>account.canvas_account_id, "course_code"=>"sub1c1", "enrollment_term_id"=>3, "id"=>1, "is_public"=> false, "name"=>"Course1", "start_at"=>"2015-02-24T19:04:00Z", "end_at"=>nil, "sis_course_id"=>"course_1_sis", "workflow_state"=>"available"},
|
14
|
+
{"account_id"=>account.canvas_account_id, "course_code"=>"sub1c2", "enrollment_term_id"=>3, "id"=>2, "is_public"=> false, "name"=>"Course2", "start_at"=>"2015-03-24T19:04:00Z", "end_at"=>nil, "sis_course_id"=>"course_2_sis", "workflow_state"=>"available"}
|
15
|
+
]}
|
16
|
+
|
17
|
+
|
12
18
|
before do
|
13
19
|
Bearcat::Client.any_instance.stub(:list_users) { double(Bearcat::ApiArray, :all_pages! => users_response) }
|
14
20
|
end
|
@@ -35,6 +41,12 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
|
|
35
41
|
end
|
36
42
|
|
37
43
|
describe '#create_records' do
|
44
|
+
it 'creates courses' do
|
45
|
+
CoalescingPanda::User.destroy_all
|
46
|
+
worker.sync_courses(courses_response)
|
47
|
+
expect(CoalescingPanda::Course.count).to eq 2
|
48
|
+
end
|
49
|
+
|
38
50
|
it 'creates users' do
|
39
51
|
CoalescingPanda::User.destroy_all
|
40
52
|
worker.sync_users(users_response)
|