canvas-lms/db/migrate/20190911182555_add_submissi...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.3 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
add submissions posted notification closes APG-103 Test Plan - Run migrations. - Set up a teacher with notifications for Grading enabled, with an email as their communication channel. - Set up at least 3 sections in a course. In New Gradebook - Create an assignment with a manual post policy (M1). - Create an assignment with an automatic post policy (A1). - Grade M1. - Verify no notifications were sent out to the teacher. - Post grades to everyone for M1. - Verify that the teacher did not receive an Assignment Unmuted notification. - Verify that the teacher received a Submissions Posted notification describing posting for everyone. - Hide grades for M1. - Post grades to only graded students for M1. - Verify that the teacher received a Submissions Posted notification describing posting for everyone graded. - Hide grades for M1. - Post grades to students in sections, with varying number of sections to test comma separation. Do it with a combination of everyone or graded as well. - Graded only, with 1, 2, and 3+ sections. - Everyone only, with 1, 2, and 3+ sections. - Verify that the teacher received a Submissions Posted notification each time, with an accurate description. - Grade A1. - Verify that the teacher did not receive a Submissions Posted or Assignment Unmuted notification. Change-Id: I47cc8fa30db443f37163b490d338101b278a1095 Reviewed-on: https://gerrit.instructure.com/210228 Tested-by: Jenkins Reviewed-by: Adrian Packel <apackel@instructure.com> Reviewed-by: Jeremy Neander <jneander@instructure.com> QA-Review: Gary Mei <gmei@instructure.com> Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-09-12 02:30:28 +08:00
#
# Copyright (C) 2019 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
class AddSubmissionsPostedNotification < ActiveRecord::Migration[5.2]
tag :predeploy
def up
return unless Shard.current == Shard.default
add submissions posted notification closes APG-103 Test Plan - Run migrations. - Set up a teacher with notifications for Grading enabled, with an email as their communication channel. - Set up at least 3 sections in a course. In New Gradebook - Create an assignment with a manual post policy (M1). - Create an assignment with an automatic post policy (A1). - Grade M1. - Verify no notifications were sent out to the teacher. - Post grades to everyone for M1. - Verify that the teacher did not receive an Assignment Unmuted notification. - Verify that the teacher received a Submissions Posted notification describing posting for everyone. - Hide grades for M1. - Post grades to only graded students for M1. - Verify that the teacher received a Submissions Posted notification describing posting for everyone graded. - Hide grades for M1. - Post grades to students in sections, with varying number of sections to test comma separation. Do it with a combination of everyone or graded as well. - Graded only, with 1, 2, and 3+ sections. - Everyone only, with 1, 2, and 3+ sections. - Verify that the teacher received a Submissions Posted notification each time, with an accurate description. - Grade A1. - Verify that the teacher did not receive a Submissions Posted or Assignment Unmuted notification. Change-Id: I47cc8fa30db443f37163b490d338101b278a1095 Reviewed-on: https://gerrit.instructure.com/210228 Tested-by: Jenkins Reviewed-by: Adrian Packel <apackel@instructure.com> Reviewed-by: Jeremy Neander <jneander@instructure.com> QA-Review: Gary Mei <gmei@instructure.com> Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-09-12 02:30:28 +08:00
Canvas::MessageHelper.create_notification({
name: "Submissions Posted",
delay_for: 0,
category: "Grading"
})
end
def down
return unless Shard.current == Shard.default
add submissions posted notification closes APG-103 Test Plan - Run migrations. - Set up a teacher with notifications for Grading enabled, with an email as their communication channel. - Set up at least 3 sections in a course. In New Gradebook - Create an assignment with a manual post policy (M1). - Create an assignment with an automatic post policy (A1). - Grade M1. - Verify no notifications were sent out to the teacher. - Post grades to everyone for M1. - Verify that the teacher did not receive an Assignment Unmuted notification. - Verify that the teacher received a Submissions Posted notification describing posting for everyone. - Hide grades for M1. - Post grades to only graded students for M1. - Verify that the teacher received a Submissions Posted notification describing posting for everyone graded. - Hide grades for M1. - Post grades to students in sections, with varying number of sections to test comma separation. Do it with a combination of everyone or graded as well. - Graded only, with 1, 2, and 3+ sections. - Everyone only, with 1, 2, and 3+ sections. - Verify that the teacher received a Submissions Posted notification each time, with an accurate description. - Grade A1. - Verify that the teacher did not receive a Submissions Posted or Assignment Unmuted notification. Change-Id: I47cc8fa30db443f37163b490d338101b278a1095 Reviewed-on: https://gerrit.instructure.com/210228 Tested-by: Jenkins Reviewed-by: Adrian Packel <apackel@instructure.com> Reviewed-by: Jeremy Neander <jneander@instructure.com> QA-Review: Gary Mei <gmei@instructure.com> Product-Review: Jonathan Fenton <jfenton@instructure.com>
2019-09-12 02:30:28 +08:00
Notification.where(name: "Submissions Posted").delete_all
end
end