coalescing_panda 3.0.1 → 3.1.0

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/coalescing_panda/canvas_batch.js.coffee.erb +40 -0
  3. data/app/controllers/coalescing_panda/canvas_batches_controller.rb +9 -0
  4. data/app/helpers/coalescing_panda/canvas_batches_helper.rb +3 -0
  5. data/app/models/coalescing_panda/canvas_batch.rb +1 -0
  6. data/app/models/coalescing_panda/user.rb +2 -0
  7. data/app/models/coalescing_panda/workers/course_miner.rb +20 -7
  8. data/app/views/coalescing_panda/canvas_batches/_canvas_batch.html.haml +15 -0
  9. data/app/views/coalescing_panda/canvas_batches/_canvas_batch_flash.html.haml +4 -0
  10. data/config/routes.rb +3 -0
  11. data/db/migrate/20141124160857_create_delayed_jobs.rb +22 -0
  12. data/lib/coalescing_panda.rb +1 -0
  13. data/lib/coalescing_panda/version.rb +1 -1
  14. data/lib/tasks/coalescing_panda_tasks.rake +9 -2
  15. data/spec/dummy/db/development.sqlite3 +0 -0
  16. data/spec/dummy/db/schema.rb +26 -1
  17. data/spec/dummy/db/test.sqlite3 +0 -0
  18. data/spec/dummy/log/development.log +12 -0
  19. data/spec/dummy/log/test.log +17033 -0
  20. data/spec/factories/accounts.rb +1 -1
  21. data/spec/factories/assignments.rb +1 -1
  22. data/spec/factories/canvas_batches.rb +6 -0
  23. data/spec/factories/courses.rb +1 -1
  24. data/spec/factories/enrollments.rb +1 -1
  25. data/spec/factories/sections.rb +6 -0
  26. data/spec/factories/submissions.rb +1 -1
  27. data/spec/factories/users.rb +1 -1
  28. data/spec/models/coalescing_panda/canvas_batch_spec.rb +7 -3
  29. data/spec/models/coalescing_panda/workers/course_miner.rb +194 -0
  30. data/spec/spec_helper.rb +7 -0
  31. metadata +44 -6
  32. data/app/assets/javascripts/coalescing_panda/canvas_batches.js +0 -2
  33. data/app/assets/stylesheets/coalescing_panda/canvas_batches.css +0 -4
  34. data/spec/factories/coalescing_panda_canvas_batches.rb +0 -7
@@ -1,5 +1,5 @@
1
1
  FactoryGirl.define do
2
- factory :account, class: LtiAccount do
2
+ factory :account, class: CoalescingPanda::LtiAccount do
3
3
  sequence :name do |n|
4
4
  "Account #{n}"
5
5
  end
@@ -1,5 +1,5 @@
1
1
  FactoryGirl.define do
2
- factory :assignment do
2
+ factory :assignment, class: CoalescingPanda::Assignment do
3
3
  name "test assignment"
4
4
  course
5
5
  sequence :canvas_assignment_id do |n|
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ factory :canvas_batch, class: CoalescingPanda::CanvasBatch do
3
+ percent_complete 0.0
4
+ status "Pending"
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
1
  FactoryGirl.define do
2
- factory :course do
2
+ factory :course, class: CoalescingPanda::Course do
3
3
  account
4
4
  name "Test Course"
5
5
  canvas_course_id "1"
@@ -1,5 +1,5 @@
1
1
  FactoryGirl.define do
2
- factory :enrollment do
2
+ factory :enrollment, class: CoalescingPanda::Enrollment do
3
3
  user
4
4
  course
5
5
  canvas_enrollment_id '123'
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ factory :section, class: CoalescingPanda::Section do
3
+ course
4
+ canvas_section_id '123'
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
1
  FactoryGirl.define do
2
- factory :submission do
2
+ factory :submission, class: CoalescingPanda::Submission do
3
3
  user
4
4
  assignment
5
5
  canvas_submission_id '123'
@@ -1,5 +1,5 @@
1
1
  FactoryGirl.define do
2
- factory :user do
2
+ factory :user, class: CoalescingPanda::User do
3
3
  sequence :email do |n|
4
4
  "test#{n}@test.com"
5
5
  end
@@ -1,7 +1,11 @@
1
1
  require 'rails_helper'
2
2
 
3
- module CoalescingPanda
4
- RSpec.describe CanvasBatch, :type => :model do
5
- pending "add some examples to (or delete) #{__FILE__}"
3
+ RSpec.describe CoalescingPanda::CanvasBatch, :type => :model do
4
+ it "default scope should order by created_at" do
5
+ batch1 = FactoryGirl.create(:canvas_batch)
6
+ batch2 = FactoryGirl.create(:canvas_batch)
7
+ batch3 = FactoryGirl.create(:canvas_batch)
8
+ expect(CoalescingPanda::CanvasBatch.all).to eq [batch3, batch2, batch1]
6
9
  end
7
10
  end
11
+
@@ -0,0 +1,194 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
4
+ let(:course) { FactoryGirl.create(:course) }
5
+ let(:worker) { CoalescingPanda::Workers::CourseMiner.new(course, [:sections, :users, :enrollments, :assignments, :submissions]) }
6
+ let(:users_response) {[
7
+ {"id"=>1, "name"=>"teacher@test.com", "sortable_name"=>"teacher@test.com", "short_name"=>"teacher@test.com", "login_id"=>"teacher@test.com"},
8
+ {"id"=>2, "name"=>"student1@test.com", "sortable_name"=>"student1@test.com", "short_name"=>"student1@test.com", "login_id"=>"student1@test.com"},
9
+ {"id"=>3, "name"=>"student2@test.com", "sortable_name"=>"student2@test.com", "short_name"=>"student2@test.com", "login_id"=>"student2@test.com"}
10
+ ]}
11
+ let(:sections_response) {[
12
+ {"course_id"=>1, "end_at"=>nil, "id"=>1, "name"=>"Course1", "nonxlist_course_id"=>nil, "start_at"=>nil, "sis_section_id"=>nil, "sis_course_id"=>"DOCSTUCOMM", "integration_id"=>nil, "sis_import_id"=>nil}
13
+ ]}
14
+ let(:enrollments_response) {[
15
+ {"associated_user_id"=>nil, "course_id"=>1, "course_section_id"=>1, "created_at"=>"2014-11-07T21:17:54Z", "end_at"=>nil, "id"=>1, "limit_privileges_to_course_section"=>false, "root_account_id"=>1, "start_at"=>nil, "type"=>"TeacherEnrollment", "updated_at"=>"2014-11-11T22:11:19Z", "user_id"=>1, "enrollment_state"=>"active", "role"=>"TeacherEnrollment", "role_id"=>4, "last_activity_at"=>"2014-11-24T16:48:54Z", "total_activity_time"=>63682, "sis_import_id"=>nil, "sis_course_id"=>"DOCSTUCOMM", "course_integration_id"=>nil, "sis_section_id"=>nil, "section_integration_id"=>nil, "html_url"=>"http://localhost:3000/courses/1/users/1", "user"=>{"id"=>1, "name"=>"teacher@test.com", "sortable_name"=>"teacher@test.com", "short_name"=>"teacher@test.com", "login_id"=>"teacher@test.com"}},
16
+ {"associated_user_id"=>nil, "course_id"=>1, "course_section_id"=>1, "created_at"=>"2014-11-07T21:18:16Z", "end_at"=>nil, "id"=>2, "limit_privileges_to_course_section"=>false, "root_account_id"=>1, "start_at"=>nil, "type"=>"StudentEnrollment", "updated_at"=>"2014-11-20T23:18:17Z", "user_id"=>2, "enrollment_state"=>"active", "role"=>"StudentEnrollment", "role_id"=>3, "last_activity_at"=>"2014-11-11T16:49:59Z", "total_activity_time"=>9243, "sis_import_id"=>nil, "grades"=>{"html_url"=>"http://localhost:3000/courses/1/grades/2", "current_score"=>90, "final_score"=>90, "current_grade"=>nil, "final_grade"=>nil}, "sis_course_id"=>"DOCSTUCOMM", "course_integration_id"=>nil, "sis_section_id"=>nil, "section_integration_id"=>nil, "html_url"=>"http://localhost:3000/courses/1/users/2", "user"=>{"id"=>2, "name"=>"student1@test.com", "sortable_name"=>"student1@test.com", "short_name"=>"student1@test.com", "login_id"=>"student1@test.com"}},
17
+ {"associated_user_id"=>nil, "course_id"=>1, "course_section_id"=>1, "created_at"=>"2014-11-07T21:18:17Z", "end_at"=>nil, "id"=>3, "limit_privileges_to_course_section"=>false, "root_account_id"=>1, "start_at"=>nil, "type"=>"StudentEnrollment", "updated_at"=>"2014-11-20T23:18:21Z", "user_id"=>3, "enrollment_state"=>"active", "role"=>"StudentEnrollment", "role_id"=>3, "last_activity_at"=>"2014-11-10T22:10:15Z", "total_activity_time"=>921, "sis_import_id"=>nil, "grades"=>{"html_url"=>"http://localhost:3000/courses/1/grades/3", "current_score"=>80, "final_score"=>80, "current_grade"=>nil, "final_grade"=>nil}, "sis_course_id"=>"DOCSTUCOMM", "course_integration_id"=>nil, "sis_section_id"=>nil, "section_integration_id"=>nil, "html_url"=>"http://localhost:3000/courses/1/users/3", "user"=>{"id"=>3, "name"=>"student2@test.com", "sortable_name"=>"student2@test.com", "short_name"=>"student2@test.com", "login_id"=>"student2@test.com"}},
18
+ ]}
19
+ let(:assignments_response) {[
20
+ {"assignment_group_id"=>1, "automatic_peer_reviews"=>false, "created_at"=>"2014-11-18T18:04:38Z", "description"=>"<p>What is your name?</p>", "due_at"=>nil, "grade_group_students_individually"=>false, "grading_standard_id"=>nil, "grading_type"=>"points", "group_category_id"=>nil, "id"=>1, "lock_at"=>nil, "peer_reviews"=>false, "points_possible"=>100, "position"=>1, "post_to_sis"=>true, "unlock_at"=>nil, "updated_at"=>"2014-11-18T18:04:42Z", "course_id"=>1, "name"=>"Gimme your name", "submission_types"=>["online_text_entry"], "has_submitted_submissions"=>false, "muted"=>false, "html_url"=>"http://localhost:3000/courses/1/assignments/1", "needs_grading_count"=>0, "integration_id"=>nil, "integration_data"=>{}, "published"=>true, "unpublishable"=>true, "locked_for_user"=>false},
21
+ {"assignment_group_id"=>1, "automatic_peer_reviews"=>false, "created_at"=>"2014-11-18T19:10:28Z", "description"=>"<p>What is your Favorite Color?</p>", "due_at"=>nil, "grade_group_students_individually"=>false, "grading_standard_id"=>nil, "grading_type"=>"points", "group_category_id"=>nil, "id"=>2, "lock_at"=>nil, "peer_reviews"=>false, "points_possible"=>100, "position"=>2, "post_to_sis"=>true, "unlock_at"=>nil, "updated_at"=>"2014-11-18T19:10:30Z", "course_id"=>1, "name"=>"Favorite Color", "submission_types"=>["online_text_entry"], "has_submitted_submissions"=>false, "muted"=>false, "html_url"=>"http://localhost:3000/courses/1/assignments/2", "needs_grading_count"=>0, "integration_id"=>nil, "integration_data"=>{}, "published"=>true, "unpublishable"=>true, "locked_for_user"=>false}
22
+ ]}
23
+ let(:submissions_response1) {[
24
+ {"assignment_id"=>1, "attempt"=>nil, "body"=>nil, "grade"=>"70", "grade_matches_current_submission"=>true, "graded_at"=>"2014-11-20T23:18:19Z", "grader_id"=>1, "id"=>3, "score"=>70, "submission_type"=>nil, "submitted_at"=>nil, "url"=>nil, "user_id"=>3, "workflow_state"=>"graded", "late"=>false, "preview_url"=>"http://localhost:3000/courses/1/assignments/1/submissions/3?preview=1"},
25
+ {"assignment_id"=>1, "attempt"=>nil, "body"=>nil, "grade"=>"100", "grade_matches_current_submission"=>true, "graded_at"=>"2014-11-20T23:18:14Z", "grader_id"=>1, "id"=>1, "score"=>100, "submission_type"=>nil, "submitted_at"=>nil, "url"=>nil, "user_id"=>2, "workflow_state"=>"graded", "late"=>false, "preview_url"=>"http://localhost:3000/courses/1/assignments/1/submissions/2?preview=1"}
26
+ ]}
27
+ let(:submissions_response2) {[
28
+ {"assignment_id"=>2, "attempt"=>nil, "body"=>nil, "grade"=>"90", "grade_matches_current_submission"=>true, "graded_at"=>"2014-11-20T23:18:21Z", "grader_id"=>1, "id"=>4, "score"=>90, "submission_type"=>nil, "submitted_at"=>nil, "url"=>nil, "user_id"=>3, "workflow_state"=>"graded", "late"=>false, "preview_url"=>"http://localhost:3000/courses/1/assignments/2/submissions/3?preview=1"},
29
+ {"assignment_id"=>2, "attempt"=>nil, "body"=>nil, "grade"=>"80", "grade_matches_current_submission"=>true, "graded_at"=>"2014-11-20T23:18:17Z", "grader_id"=>1, "id"=>2, "score"=>80, "submission_type"=>nil, "submitted_at"=>nil, "url"=>nil, "user_id"=>2, "workflow_state"=>"graded", "late"=>false, "preview_url"=>"http://localhost:3000/courses/1/assignments/2/submissions/2?preview=1"}
30
+ ]}
31
+
32
+ before do
33
+ Bearcat::Client.any_instance.stub(:list_course_users) { double(Bearcat::ApiArray, :all_pages! => users_response) }
34
+ Bearcat::Client.any_instance.stub(:course_sections) { double(Bearcat::ApiArray, :all_pages! => sections_response) }
35
+ Bearcat::Client.any_instance.stub(:course_enrollments) { double(Bearcat::ApiArray, :all_pages! => enrollments_response) }
36
+ Bearcat::Client.any_instance.stub(:assignments) { double(Bearcat::ApiArray, :all_pages! => assignments_response) }
37
+ Bearcat::Client.any_instance.stub(:get_course_submissions).with("1", "1") { double(Bearcat::ApiArray, :all_pages! => submissions_response1) }
38
+ Bearcat::Client.any_instance.stub(:get_course_submissions).with("1", "2") { double(Bearcat::ApiArray, :all_pages! => submissions_response2) }
39
+ end
40
+
41
+ describe '#initialize' do
42
+ it 'should set instance variables a user' do
43
+ expect(worker.course).to eq course
44
+ expect(worker.account).to eq course.account
45
+ expect(worker.options).to eq [:sections, :users, :enrollments, :assignments, :submissions]
46
+ expect(worker.batch).to eq CoalescingPanda::CanvasBatch.last
47
+ end
48
+ end
49
+
50
+ describe '#api_client' do
51
+ it 'returns a bearcat API client' do
52
+ expect(worker.api_client.class).to eq Bearcat::Client
53
+ end
54
+ end
55
+
56
+ describe '#start' do
57
+ it 'updates the batch to started' do
58
+ worker.start
59
+ expect(worker.batch.status).to eq 'Completed'
60
+ end
61
+ end
62
+
63
+ describe '#api_method' do
64
+ it 'returns the correct api method' do
65
+ expect(worker.api_method(:users)).to eq :list_course_users
66
+ expect(worker.api_method(:sections)).to eq :course_sections
67
+ expect(worker.api_method(:enrollments)).to eq :course_enrollments
68
+ expect(worker.api_method(:assignments)).to eq :assignments
69
+ expect(worker.api_method(:submissions)).to eq :get_course_submissions
70
+ end
71
+
72
+ it 'raises and error if method doesnt exist' do
73
+ expect{ worker.api_method(:not_a_real_method) }.to raise_error
74
+ end
75
+ end
76
+
77
+ describe '#create_records' do
78
+ it 'creates sections' do
79
+ CoalescingPanda::Section.destroy_all
80
+ worker.create_records(sections_response, :sections)
81
+ expect(CoalescingPanda::Section.count).to eq 1
82
+ end
83
+
84
+ it 'creates users' do
85
+ CoalescingPanda::User.destroy_all
86
+ worker.create_records(users_response, :users)
87
+ expect(CoalescingPanda::User.count).to eq 3
88
+ end
89
+
90
+ it 'creates enrollments' do
91
+ CoalescingPanda::Enrollment.destroy_all
92
+ worker.create_records(enrollments_response, :enrollments)
93
+ expect(CoalescingPanda::Enrollment.count).to eq 3
94
+ end
95
+
96
+ it 'creates assignments' do
97
+ CoalescingPanda::Assignment.destroy_all
98
+ worker.create_records(assignments_response, :assignments)
99
+ expect(CoalescingPanda::Assignment.count).to eq 2
100
+ end
101
+
102
+ it 'creates submissions' do
103
+ CoalescingPanda::Submission.destroy_all
104
+ submissions_response = submissions_response1 + submissions_response2
105
+ worker.create_records(submissions_response, :submissions)
106
+ expect(CoalescingPanda::Submission.count).to eq 4
107
+ end
108
+ end
109
+
110
+ describe '#standard_attributes' do
111
+ let(:start_time) { Time.now.iso8601 }
112
+ let(:end_time) { 3.weeks.from_now.iso8601 }
113
+
114
+ it 'returns a sections attributes' do
115
+ attributes = {"course_id"=>1, "end_at"=>end_time, "id"=>1, "name"=>"Course1", "nonxlist_course_id"=>nil, "start_at"=>start_time, "sis_section_id"=>"1234", "sis_course_id"=>"DOCSTUCOMM", "integration_id"=>nil, "sis_import_id"=>nil}
116
+ record = CoalescingPanda::Section.new
117
+ expect(worker.standard_attributes(record, attributes)).to eq({"end_at"=>end_time, "name"=>"Course1", "start_at"=>start_time})
118
+ end
119
+
120
+ it 'returns a users attributes' do
121
+ attributes = {"id"=>1, "name"=>"teacher@test.com", "sortable_name"=>"teacher@test.com", "short_name"=>"teacher@test.com", "login_id"=>"teacher@test.com"}
122
+ record = CoalescingPanda::User.new
123
+ expect(worker.standard_attributes(record, attributes)).to eq({"name" => "teacher@test.com"})
124
+ end
125
+
126
+ it 'returns enrollments attributes' do
127
+ attributes = {"associated_user_id"=>nil, "course_id"=>1, "course_section_id"=>1, "created_at"=>"2014-11-07T21:17:54Z", "end_at"=>end_time, "id"=>1, "limit_privileges_to_course_section"=>false, "root_account_id"=>1, "start_at"=>start_time, "type"=>"TeacherEnrollment", "updated_at"=>"2014-11-11T22:11:19Z", "user_id"=>1, "enrollment_state"=>"active", "role"=>"TeacherEnrollment", "role_id"=>4, "last_activity_at"=>"2014-11-24T16:48:54Z", "total_activity_time"=>63682, "sis_import_id"=>nil, "sis_course_id"=>"DOCSTUCOMM", "course_integration_id"=>nil, "sis_section_id"=>nil, "section_integration_id"=>nil, "html_url"=>"http://localhost:3000/courses/1/users/1", "user"=>{"id"=>1, "name"=>"teacher@test.com", "sortable_name"=>"teacher@test.com", "short_name"=>"teacher@test.com", "login_id"=>"teacher@test.com"}}
128
+ record = CoalescingPanda::Enrollment.new
129
+ expect(worker.standard_attributes(record, attributes)).to eq({"created_at"=>"2014-11-07T21:17:54Z", "end_at"=>end_time, "start_at"=>start_time, "updated_at"=>"2014-11-11T22:11:19Z"})
130
+ end
131
+
132
+ it 'returns assignment attributes' do
133
+ attributes = {"assignment_group_id"=>1, "automatic_peer_reviews"=>false, "created_at"=>"2014-11-18T18:04:38Z", "description"=>"<p>What is your name?</p>", "due_at"=>end_time, "grade_group_students_individually"=>false, "grading_standard_id"=>nil, "grading_type"=>"points", "group_category_id"=>nil, "id"=>1, "lock_at"=>start_time, "peer_reviews"=>false, "points_possible"=>100, "position"=>1, "post_to_sis"=>true, "unlock_at"=>nil, "updated_at"=>"2014-11-18T18:04:42Z", "course_id"=>1, "name"=>"Gimme your name", "submission_types"=>["online_text_entry"], "has_submitted_submissions"=>false, "muted"=>false, "html_url"=>"http://localhost:3000/courses/1/assignments/1", "needs_grading_count"=>0, "integration_id"=>nil, "integration_data"=>{}, "published"=>true, "unpublishable"=>true, "locked_for_user"=>false}
134
+ record = CoalescingPanda::Assignment.new
135
+ expect(worker.standard_attributes(record, attributes)).to eq({"created_at"=>"2014-11-18T18:04:38Z", "description"=>"<p>What is your name?</p>", "due_at"=>end_time, "lock_at"=>start_time, "points_possible"=>100, "unlock_at"=>nil, "updated_at"=>"2014-11-18T18:04:42Z", "name"=>"Gimme your name"})
136
+ end
137
+
138
+ it 'returns submission attributes' do
139
+ attributes = {"assignment_id"=>1, "attempt"=>nil, "body"=>nil, "grade"=>"70", "grade_matches_current_submission"=>true, "graded_at"=>"2014-11-20T23:18:19Z", "grader_id"=>1, "id"=>3, "score"=>70, "submission_type"=>nil, "submitted_at"=>nil, "url"=>"http://test.com", "user_id"=>3, "workflow_state"=>"graded", "late"=>false, "preview_url"=>"http://localhost:3000/courses/1/assignments/1/submissions/3?preview=1"}
140
+ record = CoalescingPanda::Submission.new
141
+ expect(worker.standard_attributes(record, attributes)).to eq({"grade"=>"70", "score"=>70, "submitted_at"=>nil, "url"=>"http://test.com", "workflow_state"=>"graded"})
142
+ end
143
+ end
144
+
145
+ describe '#sis_id' do
146
+ it 'returns sis_source_id if one exists' do
147
+ values = {"sis_source_id" => "1234"}
148
+ expect(worker.sis_id(:users, values)).to eq "1234"
149
+ end
150
+
151
+ it 'returns sis_section_id if one exists' do
152
+ values = {"sis_section_id" => "2345"}
153
+ expect(worker.sis_id(:sections, values)).to eq "2345"
154
+ end
155
+
156
+ it 'returns nil if no valid sis_id' do
157
+ values = {"not_valid_key" => "2345"}
158
+ expect(worker.sis_id(:sections, values)).to eq nil
159
+ end
160
+ end
161
+
162
+ describe '#create_associations' do
163
+ let(:user) { FactoryGirl.create(:user, account: course.account) }
164
+
165
+ it 'sets a user records account' do
166
+ record = CoalescingPanda::User.new
167
+ worker.create_associations(record, :users, {})
168
+ expect(record.account).to eq course.account
169
+ end
170
+
171
+ it 'sets an enrollments user and section' do
172
+ section = FactoryGirl.create(:section)
173
+ course.sections << section
174
+ record = CoalescingPanda::Enrollment.new
175
+ worker.create_associations(record, :enrollments, {'user_id' => user.canvas_user_id, 'course_section_id' => section.canvas_section_id})
176
+ expect(record.user).to eq user
177
+ expect(record.section).to eq section
178
+ end
179
+
180
+ it 'sets an assignments course' do
181
+ record = CoalescingPanda::Assignment.new
182
+ worker.create_associations(record, :assignments, {})
183
+ expect(record.course).to eq course
184
+ end
185
+
186
+ it 'sets an submissions' do
187
+ assignment = FactoryGirl.create(:assignment, course: course)
188
+ record = CoalescingPanda::Submission.new
189
+ worker.create_associations(record, :submissions, {'user_id' => user.canvas_user_id, 'assignment_id' => assignment.canvas_assignment_id})
190
+ expect(record.user).to eq user
191
+ expect(record.assignment).to eq assignment
192
+ end
193
+ end
194
+ end
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,14 @@ require 'shoulda/matchers'
6
6
  require 'nokogiri'
7
7
  require 'haml'
8
8
  require 'simplecov'
9
+ require 'delayed_job_active_record'
10
+ require 'factory_girl_rails'
11
+ require 'pry'
12
+ require 'webmock/rspec'
9
13
 
14
+ WebMock.disable_net_connect!
15
+
16
+ Delayed::Worker.delay_jobs = false
10
17
  SimpleCov.start
11
18
 
12
19
  # ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
metadata CHANGED
@@ -1,14 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coalescing_panda
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Mills
8
+ - Cody Tanner
9
+ - Jake Sorce
8
10
  autorequire:
9
11
  bindir: bin
10
12
  cert_chain: []
11
- date: 2014-11-21 00:00:00.000000000 Z
13
+ date: 2014-11-24 00:00:00.000000000 Z
12
14
  dependencies:
13
15
  - !ruby/object:Gem::Dependency
14
16
  name: rails
@@ -150,6 +152,20 @@ dependencies:
150
152
  - - ">="
151
153
  - !ruby/object:Gem::Version
152
154
  version: '0'
155
+ - !ruby/object:Gem::Dependency
156
+ name: delayed_job_active_record
157
+ requirement: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ version: '0'
162
+ type: :runtime
163
+ prerelease: false
164
+ version_requirements: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
153
169
  - !ruby/object:Gem::Dependency
154
170
  name: sqlite3
155
171
  requirement: !ruby/object:Gem::Requirement
@@ -262,9 +278,25 @@ dependencies:
262
278
  - - ">="
263
279
  - !ruby/object:Gem::Version
264
280
  version: '0'
281
+ - !ruby/object:Gem::Dependency
282
+ name: webmock
283
+ requirement: !ruby/object:Gem::Requirement
284
+ requirements:
285
+ - - ">="
286
+ - !ruby/object:Gem::Version
287
+ version: '0'
288
+ type: :development
289
+ prerelease: false
290
+ version_requirements: !ruby/object:Gem::Requirement
291
+ requirements:
292
+ - - ">="
293
+ - !ruby/object:Gem::Version
294
+ version: '0'
265
295
  description:
266
296
  email:
267
297
  - nathanm@instructure.com
298
+ - ctanner@instructure.com
299
+ - jake@instructure.com
268
300
  executables: []
269
301
  extensions: []
270
302
  extra_rdoc_files: []
@@ -275,14 +307,13 @@ files:
275
307
  - app/assets/javascripts/bootstrap/bootstrap-datepicker.js
276
308
  - app/assets/javascripts/bootstrap/bootstrap.js
277
309
  - app/assets/javascripts/coalescing_panda/application.js
278
- - app/assets/javascripts/coalescing_panda/canvas_batches.js
310
+ - app/assets/javascripts/coalescing_panda/canvas_batch.js.coffee.erb
279
311
  - app/assets/javascripts/coalescing_panda/oauth2.js.coffee
280
312
  - app/assets/stylesheets/bootstrap/bootstrap-datepicker.css
281
313
  - app/assets/stylesheets/bootstrap/bootstrap-overrides.css.scss
282
314
  - app/assets/stylesheets/bootstrap/bootstrap-responsive.css
283
315
  - app/assets/stylesheets/bootstrap/bootstrap.css.scss
284
316
  - app/assets/stylesheets/coalescing_panda/application.css
285
- - app/assets/stylesheets/coalescing_panda/canvas_batches.css
286
317
  - app/assets/stylesheets/coalescing_panda/launch.css.scss
287
318
  - app/assets/stylesheets/coalescing_panda/oauth2.css
288
319
  - app/controllers/coalescing_panda/application_controller.rb
@@ -303,6 +334,8 @@ files:
303
334
  - app/models/coalescing_panda/term.rb
304
335
  - app/models/coalescing_panda/user.rb
305
336
  - app/models/coalescing_panda/workers/course_miner.rb
337
+ - app/views/coalescing_panda/canvas_batches/_canvas_batch.html.haml
338
+ - app/views/coalescing_panda/canvas_batches/_canvas_batch_flash.html.haml
306
339
  - app/views/coalescing_panda/launch.html.haml
307
340
  - app/views/coalescing_panda/oauth2/oauth2.html.haml
308
341
  - app/views/coalescing_panda/oauth2/redirect.html.haml
@@ -324,6 +357,7 @@ files:
324
357
  - db/migrate/20141120153135_create_coalescing_panda_enrollments.rb
325
358
  - db/migrate/20141120205729_add_canvas_account_id_to_lti_account.rb
326
359
  - db/migrate/20141121174846_create_coalescing_panda_canvas_batches.rb
360
+ - db/migrate/20141124160857_create_delayed_jobs.rb
327
361
  - lib/coalescing_panda.rb
328
362
  - lib/coalescing_panda/controller_helpers.rb
329
363
  - lib/coalescing_panda/engine.rb
@@ -373,9 +407,10 @@ files:
373
407
  - spec/dummy/public/favicon.ico
374
408
  - spec/factories/accounts.rb
375
409
  - spec/factories/assignments.rb
376
- - spec/factories/coalescing_panda_canvas_batches.rb
410
+ - spec/factories/canvas_batches.rb
377
411
  - spec/factories/courses.rb
378
412
  - spec/factories/enrollments.rb
413
+ - spec/factories/sections.rb
379
414
  - spec/factories/submissions.rb
380
415
  - spec/factories/users.rb
381
416
  - spec/helpers/coalescing_panda/canvas_batches_helper_spec.rb
@@ -390,6 +425,7 @@ files:
390
425
  - spec/models/coalescing_panda/submission_spec.rb
391
426
  - spec/models/coalescing_panda/term_spec.rb
392
427
  - spec/models/coalescing_panda/user_spec.rb
428
+ - spec/models/coalescing_panda/workers/course_miner.rb
393
429
  - spec/rails_helper.rb
394
430
  - spec/spec_helper.rb
395
431
  homepage: http://www.instructure.com
@@ -459,9 +495,10 @@ test_files:
459
495
  - spec/dummy/README.rdoc
460
496
  - spec/factories/accounts.rb
461
497
  - spec/factories/assignments.rb
462
- - spec/factories/coalescing_panda_canvas_batches.rb
498
+ - spec/factories/canvas_batches.rb
463
499
  - spec/factories/courses.rb
464
500
  - spec/factories/enrollments.rb
501
+ - spec/factories/sections.rb
465
502
  - spec/factories/submissions.rb
466
503
  - spec/factories/users.rb
467
504
  - spec/helpers/coalescing_panda/canvas_batches_helper_spec.rb
@@ -476,6 +513,7 @@ test_files:
476
513
  - spec/models/coalescing_panda/submission_spec.rb
477
514
  - spec/models/coalescing_panda/term_spec.rb
478
515
  - spec/models/coalescing_panda/user_spec.rb
516
+ - spec/models/coalescing_panda/workers/course_miner.rb
479
517
  - spec/rails_helper.rb
480
518
  - spec/spec_helper.rb
481
519
  has_rdoc:
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */
@@ -1,7 +0,0 @@
1
- FactoryGirl.define do
2
- factory :coalescing_panda_canvas_batch, :class => 'CoalescingPanda::CanvasBatch' do
3
- percent_complete "MyString"
4
- status "MyString"
5
- end
6
-
7
- end