forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
graphql: make assignment override instrumenter work
closes RECNVS-308 Test plan: * set up assignments with overrides in a variety of situations * assignment dates should be overridden appropriately * assignment due dates are *not* overridden when enumerating assignmentOverrides Change-Id: Iefec250bbcf095fb40cfb3b204f3521676e0d9f9 Reviewed-on: https://gerrit.instructure.com/142505 Tested-by: Jenkins Reviewed-by: Keith T. Garner <[email protected]> Reviewed-by: Jonathan Featherstone <[email protected]> QA-Review: Collin Parrish <[email protected]> Product-Review: Cameron Matheson <[email protected]>
- Loading branch information
Showing
2 changed files
with
54 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# | ||
# Copyright (C) 2018 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/>. | ||
# | ||
|
||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb') | ||
|
||
describe AssignmentOverrideInstrumenter do | ||
context '#needs_overriding?' do | ||
it "doesn't override when no overrideable attributes are requested" do | ||
expect( | ||
AssignmentOverrideInstrumenter.needs_overriding?("id" => true) | ||
).to eq false | ||
end | ||
|
||
it "overrides when overrideable attributes are requested" do | ||
%w[dueAt unlockAt lockAt].each { |overrideable_attribute| | ||
expect( | ||
AssignmentOverrideInstrumenter.needs_overriding?(overrideable_attribute => true) | ||
).to eq true | ||
} | ||
end | ||
|
||
it "doesn't override if assignment_overrides are requested" do | ||
expect( | ||
AssignmentOverrideInstrumenter.needs_overriding?( | ||
"dueAt" => true, "assignmentOverrides" => true | ||
) | ||
).to eq false | ||
end | ||
end | ||
end |