coalescing_panda 4.1.13 → 4.1.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,7 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
17
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
18
  ]}
19
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},
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"=>1, "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
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
22
  ]}
23
23
  let(:submissions_response1) {[
@@ -28,13 +28,16 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
28
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
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
30
  ]}
31
+ let(:group_categories_response){[
32
+ {"auto_leader" => "first", "group_limit" => nil, "id" => 1, "name" => "mark red", "role" => nil, "self_signup" => nil, "context_type" => "Course", "course_id" => 1, "protected" => false, "allows_multiple_memberships" => false, "is_member" => false}
33
+ ]}
31
34
  let(:groups_response){[
32
- {"description"=> nil, "group_category_id"=> 3, "id"=> 4, "is_public"=> false, "join_level"=> "invitation_only", "max_membership"=> 5, "name"=> "Student Group 1", "members_count"=> 2, "storage_quota_mb"=> 50, "context_type"=> "CoalescingPanda::Course", "course_id"=> 1, "avatar_url"=> nil, "role"=> nil, "leader"=> nil},
33
- {"description"=> nil, "group_category_id"=> 3, "id"=> 5, "is_public"=> false, "join_level"=> "invitation_only", "max_membership"=> 5, "name"=> "Student Group 2", "members_count"=> 2, "storage_quota_mb"=> 50, "context_type"=> "CoalescingPanda::Course", "course_id"=> 1, "avatar_url"=> nil, "role"=> nil, "leader"=> nil}
35
+ {"description"=> nil, "group_category_id"=> 1, "id"=> 4, "is_public"=> false, "join_level"=> "invitation_only", "max_membership"=> 5, "name"=> "Student Group 1", "members_count"=> 2, "storage_quota_mb"=> 50, "context_type"=> "CoalescingPanda::Course", "course_id"=> 1, "avatar_url"=> nil, "role"=> nil, "leader"=> {"id"=>2}},
36
+ {"description"=> nil, "group_category_id"=> nil, "id"=> 5, "is_public"=> false, "join_level"=> "invitation_only", "max_membership"=> 5, "name"=> "Student Group 2", "members_count"=> 2, "storage_quota_mb"=> 50, "context_type"=> "CoalescingPanda::Course", "course_id"=> 1, "avatar_url"=> nil, "role"=> nil, "leader"=> nil}
34
37
  ]}
35
38
  let(:membership_response){[
36
- {"group_id"=> 4, "id"=> 13, "moderator"=> false, "user_id"=> 2, "workflow_state"=> "accepted"},
37
- {"group_id"=> 4, "id"=> 14, "moderator"=> false, "user_id"=> 3, "workflow_state"=> "accepted"}
39
+ {"group_id"=> 4, "id"=> 13, "moderator"=> "true", "user_id"=> 2, "workflow_state"=> "accepted"},
40
+ {"group_id"=> 4, "id"=> 14, "moderator"=> "false", "user_id"=> 3, "workflow_state"=> "accepted"}
38
41
  ]}
39
42
  let(:assignment_groups_response) {[
40
43
  {"group_weight" => 500, "id" => 3, "name" => "Assignments", "position" => 3, "rules" => {} }
@@ -97,10 +100,17 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
97
100
  expect(CoalescingPanda::Enrollment.last.workflow_state).to eq "active"
98
101
  end
99
102
 
103
+ it 'creates group categories' do
104
+ worker.sync_group_categories(group_categories_response)
105
+ expect(CoalescingPanda::GroupCategory.count).to eq 1
106
+ end
107
+
100
108
  it 'creates assignments' do
101
109
  CoalescingPanda::Assignment.destroy_all
110
+ worker.sync_group_categories(group_categories_response)
102
111
  worker.sync_assignments(assignments_response)
103
112
  expect(CoalescingPanda::Assignment.count).to eq 2
113
+ expect(CoalescingPanda::Assignment.find_by(canvas_assignment_id: 1).group_category).to_not be_nil
104
114
  end
105
115
 
106
116
  it 'creates assignment groups' do
@@ -123,8 +133,20 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
123
133
 
124
134
  it 'creates groups' do
125
135
  CoalescingPanda::Group.destroy_all
136
+ worker.sync_group_categories(group_categories_response)
137
+ worker.sync_groups(groups_response)
138
+ expect(CoalescingPanda::Group.count).to eq 2
139
+ expect(CoalescingPanda::Group.find_by(canvas_group_id: 4)).to_not be_nil
140
+ end
141
+
142
+ it 'creates groups with leaders' do
143
+ CoalescingPanda::Group.destroy_all
144
+ worker.sync_sections(sections_response)
145
+ worker.sync_users(users_response)
146
+ worker.sync_enrollments(enrollments_response)
126
147
  worker.sync_groups(groups_response)
127
148
  expect(CoalescingPanda::Group.count).to eq 2
149
+ expect(CoalescingPanda::Group.where(canvas_group_id: "4").first.leader).to_not be_nil
128
150
  end
129
151
 
130
152
  it 'creates group memberships' do
@@ -175,9 +197,9 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
175
197
  end
176
198
 
177
199
  it 'returns group membership attributes' do
178
- attributes = {"group_id"=> 4,"id"=> 13,"moderator"=> false,"user_id"=> 2,"workflow_state"=> "accepted"}
200
+ attributes = {"group_id"=> 4,"id"=> 13,"moderator"=> "false","user_id"=> 2,"workflow_state"=> "accepted"}
179
201
  record = CoalescingPanda::GroupMembership.new
180
- expect(worker.standard_attributes(record, attributes)).to eq({"workflow_state" => "accepted"})
202
+ expect(worker.standard_attributes(record, attributes)).to eq({"moderator"=> "false", "workflow_state" => "accepted"})
181
203
  end
182
204
  end
183
205
 
@@ -194,4 +216,4 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
194
216
  expect(batch.status).to eq 'Started'
195
217
  end
196
218
  end
197
- end
219
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coalescing_panda
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.13
4
+ version: 4.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Mills
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-06-25 00:00:00.000000000 Z
13
+ date: 2015-07-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -30,16 +30,16 @@ dependencies:
30
30
  name: bearcat
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ">="
33
+ - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: '0'
35
+ version: 1.0.21
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ">="
40
+ - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: '0'
42
+ version: 1.0.21
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: macaddr
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -336,6 +336,7 @@ files:
336
336
  - app/models/coalescing_panda/course.rb
337
337
  - app/models/coalescing_panda/enrollment.rb
338
338
  - app/models/coalescing_panda/group.rb
339
+ - app/models/coalescing_panda/group_category.rb
339
340
  - app/models/coalescing_panda/group_membership.rb
340
341
  - app/models/coalescing_panda/lti_account.rb
341
342
  - app/models/coalescing_panda/lti_nonce.rb
@@ -378,6 +379,9 @@ files:
378
379
  - db/migrate/20150506192717_add_assignment_group_id_to_assignments.rb
379
380
  - db/migrate/20150526144713_add_account_to_canvas_batches.rb
380
381
  - db/migrate/20150602205257_add_option_to_canvas_batches.rb
382
+ - db/migrate/20150708192717_add_group_moderator_to_group_memberships.rb
383
+ - db/migrate/20150709192717_add_leader_id_to_groups.rb
384
+ - db/migrate/20150714205405_create_coalescing_panda_group_categories.rb
381
385
  - lib/coalescing_panda.rb
382
386
  - lib/coalescing_panda/bearcat_uri.rb
383
387
  - lib/coalescing_panda/controller_helpers.rb
@@ -394,7 +398,6 @@ files:
394
398
  - spec/dummy/app/assets/stylesheets/application.css
395
399
  - spec/dummy/app/controllers/application_controller.rb
396
400
  - spec/dummy/app/helpers/application_helper.rb
397
- - spec/dummy/app/models/account.rb
398
401
  - spec/dummy/app/views/layouts/application.html.erb
399
402
  - spec/dummy/bin/bundle
400
403
  - spec/dummy/bin/rails
@@ -436,7 +439,6 @@ files:
436
439
  - spec/factories/submissions.rb
437
440
  - spec/factories/terms.rb
438
441
  - spec/factories/users.rb
439
- - spec/helpers/coalescing_panda/canvas_batches_helper_spec.rb
440
442
  - spec/models/coalescing_panda/assignment_group_spec.rb
441
443
  - spec/models/coalescing_panda/assignment_spec.rb
442
444
  - spec/models/coalescing_panda/canvas_api_auth_spec.rb
@@ -473,7 +475,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
473
475
  version: '0'
474
476
  requirements: []
475
477
  rubyforge_project:
476
- rubygems_version: 2.4.5
478
+ rubygems_version: 2.2.2
477
479
  signing_key:
478
480
  specification_version: 4
479
481
  summary: Canvas LTI and OAUTH2 mountable engine
@@ -485,7 +487,6 @@ test_files:
485
487
  - spec/dummy/app/assets/stylesheets/application.css
486
488
  - spec/dummy/app/controllers/application_controller.rb
487
489
  - spec/dummy/app/helpers/application_helper.rb
488
- - spec/dummy/app/models/account.rb
489
490
  - spec/dummy/app/views/layouts/application.html.erb
490
491
  - spec/dummy/bin/bundle
491
492
  - spec/dummy/bin/rails
@@ -529,7 +530,6 @@ test_files:
529
530
  - spec/factories/submissions.rb
530
531
  - spec/factories/terms.rb
531
532
  - spec/factories/users.rb
532
- - spec/helpers/coalescing_panda/canvas_batches_helper_spec.rb
533
533
  - spec/models/coalescing_panda/assignment_group_spec.rb
534
534
  - spec/models/coalescing_panda/assignment_spec.rb
535
535
  - spec/models/coalescing_panda/canvas_api_auth_spec.rb
@@ -547,4 +547,3 @@ test_files:
547
547
  - spec/models/coalescing_panda/workers/course_miner_spec.rb
548
548
  - spec/rails_helper.rb
549
549
  - spec/spec_helper.rb
550
- has_rdoc:
@@ -1,7 +0,0 @@
1
-
2
- class Account < CoalescingPanda::LtiAccount
3
- has_many :terms, foreign_key: :coalescing_panda_lti_account_id, class_name: 'Term'
4
- has_many :courses, foreign_key: :coalescing_panda_lti_account_id, class_name: 'Course'
5
- has_many :users, foreign_key: :coalescing_panda_lti_account_id, class_name: 'User'
6
- end
7
-
@@ -1,17 +0,0 @@
1
- require 'rails_helper'
2
-
3
- # Specs in this file have access to a helper object that includes
4
- # the CanvasBatchesHelper. For example:
5
- #
6
- # describe CanvasBatchesHelper do
7
- # describe "string concat" do
8
- # it "concats two strings with spaces" do
9
- # expect(helper.concat_strings("this","that")).to eq("this that")
10
- # end
11
- # end
12
- # end
13
- module CoalescingPanda
14
- RSpec.describe CanvasBatchesHelper, :type => :helper do
15
- pending "add some examples to (or delete) #{__FILE__}"
16
- end
17
- end