From 6d9aae54b043503363f43bf5a24990a525322b8e Mon Sep 17 00:00:00 2001 From: Andrew Butterfield Date: Tue, 17 Oct 2017 15:24:35 -0700 Subject: [PATCH] Change references to grade_changed event to grade_change event fixes PLAT-2867 Test plan: * Ensure documentation is correct for both live events and lti capabilities * Ensure grade_change capability works for LTI 2 tools Change-Id: I68c381883a9feb50f2f3705f1aa0f122db766e61 Reviewed-on: https://gerrit.instructure.com/130067 Tested-by: Jenkins Reviewed-by: Weston Dransfield QA-Review: August Thornton Product-Review: Andrew Butterfield --- app/models/lti/tool_consumer_profile.rb | 2 +- doc/api/live_events.md | 2 +- doc/api/subscriptions_appendix.md | 4 ++-- doc/live_events.md | 2 +- spec/apis/lti/subscriptions_validator_spec.rb | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/models/lti/tool_consumer_profile.rb b/app/models/lti/tool_consumer_profile.rb index 545f668db532..988850fd8bf3 100644 --- a/app/models/lti/tool_consumer_profile.rb +++ b/app/models/lti/tool_consumer_profile.rb @@ -33,7 +33,7 @@ class ToolConsumerProfile < ActiveRecord::Base all: [WEBHOOK_GRANT_ALL_CAPABILITY].freeze, quiz_submitted: %w(vnd.instructure.webhooks.root_account.quiz_submitted vnd.instructure.webhooks.assignment.quiz_submitted).freeze, - grade_changed: %w(vnd.instructure.webhooks.root_account.grade_changed).freeze, + grade_change: %w(vnd.instructure.webhooks.root_account.grade_change).freeze, attachment_created: %w(vnd.instructure.webhooks.root_account.attachment_created vnd.instructure.webhooks.assignment.attachment_created).freeze, submission_created: %w(vnd.instructure.webhooks.root_account.submission_created diff --git a/doc/api/live_events.md b/doc/api/live_events.md index 88fd87167456..d617f54f4fd7 100644 --- a/doc/api/live_events.md +++ b/doc/api/live_events.md @@ -218,7 +218,7 @@ No extra data. | `quiz_id` | The Canvas id of the quiz. | -#### `grade_changed` +#### `grade_change` `grade_change` events are posted every time a grade changes. These can happen as the result of a teacher changing a grade in the gradebook or diff --git a/doc/api/subscriptions_appendix.md b/doc/api/subscriptions_appendix.md index cd8683260a03..9e274658f00e 100644 --- a/doc/api/subscriptions_appendix.md +++ b/doc/api/subscriptions_appendix.md @@ -7,8 +7,8 @@ subscriptions of the associated type. * vnd.instructure.webhooks.root_account.quiz_submitted * vnd.instructure.webhooks.assignment.quiz_submitted -### `GRADE_CHANGED` Event Type -* vnd.instructure.webhooks.root_account.grade_changed +### `GRADE_CHANGE` Event Type +* vnd.instructure.webhooks.root_account.grade_change ### `ATTACHMENT_CREATED` Event Type * vnd.instructure.webhooks.root_account.attachment_created diff --git a/doc/live_events.md b/doc/live_events.md index 5900cc60b559..111ba20e3d89 100644 --- a/doc/live_events.md +++ b/doc/live_events.md @@ -4,7 +4,7 @@ Canvas includes the ability to push a subset of real-time events to a Kinesis stream, which can then be consumed for various analytics purposes. This is not a full-fidelity feed of all changes to the database, but a targetted set of interesting actions such as -`grade_changed`, `login`, etc. +`grade_change`, `login`, etc. ## Development and Testing diff --git a/spec/apis/lti/subscriptions_validator_spec.rb b/spec/apis/lti/subscriptions_validator_spec.rb index ccc80f1436f8..a96f4664a067 100644 --- a/spec/apis/lti/subscriptions_validator_spec.rb +++ b/spec/apis/lti/subscriptions_validator_spec.rb @@ -82,11 +82,11 @@ module Lti end end - context "GRADE_CHANGED" do + context "GRADE_CHANGE" do let(:subscription) do { RootAccountUUID: account.uuid, - EventTypes:["grade_changed"], + EventTypes:["grade_change"], ContextType: "root_account", ContextId: account.uuid, Format: "live-event", @@ -103,12 +103,12 @@ module Lti product_family: product_family, product_version: '1', workflow_state: 'active', - raw_data: {'enabled_capability' => ['vnd.instructure.webhooks.root_account.grade_changed']}, + raw_data: {'enabled_capability' => ['vnd.instructure.webhooks.root_account.grade_change']}, lti_version: '1' ) end - it 'allows subscription if vnd.instructure.webhooks.root_account.grade_changed' do + it 'allows subscription if vnd.instructure.webhooks.root_account.grade_change' do validator = SubscriptionsValidator.new(subscription, tool_proxy) expect { validator.check_required_capabilities! }.not_to raise_error end