Commit Graph

76 Commits

Author SHA1 Message Date
Cody Cutrer 47119da659 spec: remove sharding_spec_helper requires
[skip-stages=Flakey]

the main spec_helper already requires it

Change-Id: Ibcd905aa7ae603c8cdfa3cd24216e16aee252a8f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276853
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-28 00:19:18 +00:00
Cody Cutrer 0a025efa2f spec: use require_relative instead of require File.expand_path
[skip-stages=Flakey]

Change-Id: I861a46acffa893b4ea6630039da66851c71b5a77
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276831
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-28 00:15:03 +00:00
Cody Cutrer 6cb0ea010c RuboCop: Lint/UselessAssignment spec
[skip-stages=Flakey]

all manual

Change-Id: I615934f94060ed339c17d6a73599487dc577e376
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276433
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-21 13:38:12 +00:00
Cody Cutrer dbd8c46655 RuboCop: Lint
[skip-stages=Flakey]

auto corrections applied:
 * Lint/AmbiguousOperator
 * Lint/AmbiguousOperatorPrecedence
 * Lint/AmbiguousRegexpLiteral
 * Lint/DeprecatedClassMethods
 * Lint/DeprecatedOpenSSLConstant
 * Lint/NonDeterministicRequireOrder
 * Lint/ParenthesesAsGroupedExpression
 * Lint/RedundantRequireStatement
 * Lint/RedundantSafeNavigation
 * Lint/RedundantSplatExpansion
 * Lint/RedundantStringCoercion
 * Lint/RedundantWithIndex
 * Lint/SendWithMixinArgument
 * Lint/SymbolConversion

Change-Id: I222ec19978033544513bb99755994d109435abad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274551
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-29 03:38:23 +00:00
Cody Cutrer b6e406ddcf RuboCop: RSpec/ExampleWording
[skip-stages=Flakey]

Change-Id: I291432cd1f51fdaefb3cf6160d423879fb858c11
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274253
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-24 02:15:35 +00:00
Cody Cutrer 649ed90556 RuboCop: Layout spec/lib
[skip-stages=Flakey]

Change-Id: I8ea79181841e3da783801500e26f630770c4d672
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274150
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 19:17:20 +00:00
Cody Cutrer 69a7155b0e bump switchman
also have to fix several cases where cross-shard queries have indeterminate order

Change-Id: I1faf5953787859c24481e51dad3cf60d6d332a96
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266738
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-06-21 15:31:52 +00:00
Cody Cutrer 4e5aeabf01 record where a user was merged in to
Change-Id: Ia02495da93a193daa7c61ce65a9d40d3e336c813
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263688
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-04-27 17:17:34 +00:00
Rob Orton 9d2604c4e5 leave root_account out of the find and create
there is an index on the user_id and context_id, we want to find from
the keys of the index and let root_account get populated from favorite
context

test plan
 - specs should pass

fixes VICE-1236
flag=none

Change-Id: I70f2ceaa941d38cd7a7de054b0888044d3325a25
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261298
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2021-03-23 16:18:10 +00:00
August Thornton f3822b817b spec: fix flaky past_lti_id user merge spec
load the context's shard before looking up past_lti_ids

test plan:
 • specs pass
 • verify in splunk after merge the test is no longer flaky

Change-Id: I5ee1967f17b5396254c6ea5567742eaaf57ad8b4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261169
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2021-03-19 21:41:31 +00:00
Simon Williams c7224cf89f improve user merge for user observer links
fixes FOO-1591
flag = none

test plan:
- have two users observing the same student
- remove user 1 as an observer
- merge user 2 into user 1
- it should work

Change-Id: Ic7cecc446e88a62916329d0411fa49d0787f89a1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258572
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2021-03-18 16:34:40 +00:00
Rob Orton f49a66f26b spec: reload user before checking for past_lti_ids
Change-Id: I8291f48ea86f68243acc31c0c44aa271851442d0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260605
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-03-13 03:49:47 +00:00
Rob Orton 8e110479d0 copy all favorites on merge
test plan
 - use api or mobile app to set favorite for a group
 - merge with another user
 - the favorite should come over

fixes FOO-1441
flag=none

Change-Id: I6f1cdd3e0287b1d286b87bde739edb9addcf46b6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256066
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-01-08 18:42:56 +00:00
Cody Cutrer 81d0bbc465 add # frozen_string_literal: true for specs
Change-Id: Id508bec1817937b1c24c29f1db7221e09cb9c2ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251157
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:48:35 +00:00
Rob Orton b4d2f91c70 populate communication_channels root_account_ids
communication_channels only live on users shard and they only work on
users shard. There have been bugs that were incorrectly placing them on
a different shard, but they never worked.

users invited into a course get a user object created as pre-registered,
but they do not get root_account_ids set until after they have clicking
the email. the email can also cause a user merge that would put the
communication_channel on the merged user but again the root_account_ids
would not be present until after that process so before_create was not
enough to populate communication_channels.

this commit also makes it so the channels are just populated on a user
merge event, since they could change, this is also appropriate.

after a datafix up is run ids should be populated but log a stat when we
send a message to ensure it.

fixes VICE-895
flag=none

Change-Id: I4721a563988f8fa399fca9d23b73e17c2a6371e7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249227
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-10-05 22:42:55 +00:00
Rob Orton 83a260762a handle sharding properly for past past_lti_ids
test plan
 - specs should pass
 - have a user on shard 1
 - enroll the user in a course
 - on shard2 merge the shard1 user into a user on shard2
 - it should not throw an FK violation error

risk low, specs fail without code change

fixes VICE-777
flag=none

Change-Id: Iefc62bc426ca3ae8179fcd6a286a0d9a5dec48e8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246989
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2020-09-09 22:25:49 +00:00
Simon Williams e829bae0b9 fix user merge cross shard favorite de-duping
closes FOO-899
flag=none

test plan: (specs should cover)
- have two users on two different shards
- have both users "favorite" the same course on one of the shards
- merge them
- it should work

Change-Id: I444b89467dd12933f480a9fface3497914220c9b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246155
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-08-27 13:23:20 +00:00
August Thornton 8ff4bebce5 spec: fix flakey rspec user merge spec
fixes FOO-755
flag = none

test plan:
 - specs pass

Change-Id: I0e0bba777f78da5d80855ab8912e8c691120a7c3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244912
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2020-08-13 17:22:52 +00:00
Ryan Norton 3da8f2d33d spec: skip flaky UserMerge spec
ticket to track unskip and fix: FOO-755

Change-Id: I2b062684d2aaa3c07ee78809c945537abe43246e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244004
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-07-31 21:37:14 +00:00
August Thornton eaea07ccd4 spec: prefer redis cache store
I decided to go this direction for two reasons. We are using
Redis for caching in production, and we want this test to mirror
that environment as closely as possible. Also it seemed the error
was timing related when doing a lookup on notifications,
memcache got deleted when the cached objects were expected to be
there. Having a separate cache store will add a more reliable
persistence layer.

fixes FOO-755
flag = none

test plan:
 - specs pass
 - no flaky flaky

Change-Id: I5db414d5ed0d47250d3247e63a81fdef0157b8ce
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/243812
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-07-30 21:23:05 +00:00
Matthew Lemon b1ba4a9b9d SPEC: use factory to create comm channels in specs
Doing this will make any changes to communication channels in the future
100000000000% easier by limiting the blast radius to just a handful of
files rather than every single spec file in canvas_lms LOL

fixes VICE-540
flag=none

/ ---- ---- \
| Test Plan |
\ ---- ---- /

- tests pass

Change-Id: I9a61b3c7155bc76e0f813b4f35466baf6a8f7589
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/239871
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2020-07-27 16:22:01 +00:00
James Williams ec00892c7e move unbounded user preference data to separate table
such as gradebook column settings stored for every
course, etc

test plan:
* all user preferences should behave as before, such as
 gradebook column sizes, course nicknames,
 dashboard card color settings, etc

closes #LA-571

Change-Id: I6896e0d97d577c554d450f377137cb4d6e78e2ef
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/226119
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2020-03-02 20:10:32 +00:00
Rob Orton a734b68c45 log who and how a user was merged
test plan
 - merge a user via api
 - the merged data in the console will have the user that did the merge

fixes CORE-3284

Change-Id: I193c1cd40fd056be9fef6c5961f5ac5bf9aed419
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/219862
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2019-12-11 22:43:01 +00:00
Rob Orton 9351a90b8d don't allow merging a fake user
fixes CORE-3283

test plan
 - try to merge fake user
 - it will fail
 - specs should pass

Change-Id: I214990fa285080f41d5e76b785cc34978dc81e7f
Reviewed-on: https://gerrit.instructure.com/207058
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-08-28 00:32:35 +00:00
Rob Orton 9d889956d2 mark failed merges as failed and capture the error
fixes CORE-2964

test plan
 - merge a user that would fail
 - it should show error

Change-Id: If93c1cef615b0929ba4fc5e6f8f58bc87e6999af
Reviewed-on: https://gerrit.instructure.com/193865
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Nathan Mills <nathanm@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2019-05-20 17:05:46 +00:00
Rob Orton fb080136fd handle course nicknames on user merge
refs CORE-2880

test plan
 - set nickname for course
 - merge users
 - nickname should come over

Change-Id: I298f88163c838f2344a579fcf427ec96229f93d9
Reviewed-on: https://gerrit.instructure.com/191922
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-05-02 21:41:25 +00:00
Rob Orton a577152cca handle favorites and preferences with sharding
fixes CORE-2880

test plan
 - merge cross shard users with favorites, course
   card colors, and nicknames
 - they should all work

Change-Id: I7ed5ed4e08b5299b8aa4e2ea91e5053ceae9aa2e
Reviewed-on: https://gerrit.instructure.com/191817
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2019-05-02 15:32:18 +00:00
Rob Orton 10e3bb5469 handle past_lti_ids for multiple merges
Change-Id: Ide304422ff52f1ab215959f5dc184e08cade2dfe
Reviewed-on: https://gerrit.instructure.com/189624
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-04-17 19:51:06 +00:00
Rob Orton 3ff025385d handle user preferences and name
also use consistent users and just get them from
the class instead of passing them around

fixes CORE-271
fixes CORE-272

test plan
 - merge a user with prefs
 - they should come through

Change-Id: I1debabbffed1dba8b1c215aa676a51a5b5dc4c53
Reviewed-on: https://gerrit.instructure.com/187281
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-03-29 22:17:07 +00:00
Rob Orton c4de231b0e support past lti ids for users
when a user_a is merged into user_b, user_a is
deleted, but the enrollments lti_tools still point
to the old lti_id, so this allows us to store them
and serve them as the lti_id when a user is merged

fixes CORE-2565

test plan
 - merge a user that uses an lti tool in a course
 - the lti_id should not change for that course

Change-Id: Iac70957ed1fcb08111745a91d0c2e402dfad3002
Reviewed-on: https://gerrit.instructure.com/181905
Tested-by: Jenkins
Reviewed-by: Marc Phillips <mphillips@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2019-03-28 22:03:07 +00:00
Rob Orton 886e00b554 create shard associations for user merge users
these have been created as the user does things on
the cross shard objects, but we should they should
be created when the user is merged.
This also allows us to put FKs on the columns.

refs CORE-2572

test plan
 - specs should pass

Change-Id: I9364653b9c16b893291709943020c5989ae798a5
Reviewed-on: https://gerrit.instructure.com/185440
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2019-03-21 17:37:14 +00:00
James Williams b54a9b491d look for existing trust enrollments when adding an observer link
currently works for enrollments created after the link but
this will fix it so it looks across the trust for existing
enrollments when creating the link

also remove enrollments across trust when link is deleted

and require root account because why not

closes #CORE-2486

Change-Id: I861690eee819d14f9520084aa55cfa051a32aca1
Reviewed-on: https://gerrit.instructure.com/181448
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2019-03-04 13:19:24 +00:00
James Williams 3648396895 merge conversations when cross-shard
test plan:
* have a user with conversations
* merge the user into one on another shard
* the conversations should remain in the inbox

closes #CORE-1895

Change-Id: I4792c98e3ead122e954ba2b3e0335dcdb99dae69
Reviewed-on: https://gerrit.instructure.com/165371
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2018-10-04 12:10:08 +00:00
James Williams 684f561d88 mark user_id on cross-shard merged user attachments
and use that to confirm that versioned submission
 attachments belong to the user

test plan:
* have a student in a course on one shard
* submit a file to an assignment
* merge the user into a user on another shard
* the submission should still list the files

closes #ADMIN-1447

Change-Id: I4a1f00ac1a375cfb247cef5e6fa4f875c2bce316
Reviewed-on: https://gerrit.instructure.com/165174
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-09-21 17:05:39 +00:00
James Williams 2b0f57c560 rename user_observer/observee classes/associations
for my sanity because it's too confusing to actually refactor

closes #CORE-1140

Change-Id: I445e0edeb3fde76ffd02a467180ee7a83d916067
Reviewed-on: https://gerrit.instructure.com/143538
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2018-03-14 19:51:49 +00:00
Rob Orton 52ced9231d don’t delete submissions on user merge
fixes CORE-1069
refs CORE-1026

test plan
 - have 2 users with conflicting submissions
   one with grade one with submission
 - merge them
 - split them and it should be restored

Change-Id: Id645ddcc0c5182a825e513de7e7d05e6fa50f254
Reviewed-on: https://gerrit.instructure.com/142004
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-03-14 16:49:52 +00:00
Rob Orton beffd57f7a cleanup invalid quiz_submissions on user merge
fixes CNVS-38707

test plan
 - user merge should work

Change-Id: I4378b075ae806e8813a9f9d1224c2a96b33d3727
Reviewed-on: https://gerrit.instructure.com/123507
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2017-08-22 16:49:22 +00:00
James Williams 45147e0911 bypass the wiki model as much as possible for wiki_pages
Change-Id: I60ec3b519219fcb5256a132c05f63538600df73f
Reviewed-on: https://gerrit.instructure.com/121760
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-09 16:09:06 +00:00
Landon Wilkins a55623016d da licença part 47
add consistent license headers to all source files

Change-Id: I8d372efee113550ada3255f32ec6f1858e5520c4
Reviewed-on: https://gerrit.instructure.com/110152
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-28 17:59:55 +00:00
Simon Williams 57497719a7 spec: rename the `course` helper to `course_factory`
closes CNVS-34046

test plan: specs should pass

Change-Id: I8684d30e5af7be04566b2d3903db2b7f4b14b24b
Reviewed-on: https://gerrit.instructure.com/98439
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-27 20:25:29 +00:00
Simon Williams ece65b5a89 spec: rename the `user` helper to `user_factory`
closes CNVS-34042

test plan: specs should pass

Change-Id: I20709a69f0cb28fb55eba18ca81f89f4d7673b56
Reviewed-on: https://gerrit.instructure.com/98426
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-27 20:25:25 +00:00
Shahbaz Javeed 95283746ea prevent grading if submission is due in closed grading period
closes CNVS-32229
closes CNVS-32232

test plan:
* Create a course with MGP enabled and two grading periods in
  the default term
* Create two assignments for this course, one in a closed GP and
  one in an open GP
* To test overrides, create the following as well:
  * For one of the students, make the open assignment due in the
    closed grading period
  * For another student, make the closed assignment due in the
    open grading period

* Ensure the following steps work for all assignment/student
  combos due in a closed grading period.

** CNVS-32229 **
* Login as a teacher
* Go to speedgrader for the assignment in the closed GP
* Notice that the grade input is locked down
* Right click on the locked-down input and select 'Inspect'
* Remove the 'ui-state-disabled' class and remove
  readonly="readonly" from the input field's HTML
* Notice the input is no longer grayed out and you can enter
  a grade
* Enter a grade and tab out of the input
* You should see an error message that says something went wrong
  and notice in the Network tab of your dev tools that the AJAX
  post failed, meaning the submission was not gradeable
* Refresh the page and notice the grade is not there.
* Verify it isn't there in Gradebook either

* Login as an admin
* Go to speedgrader for the assignment in the closed GP
* Notice that the grade input is *not* locked down
* Enter a grade and tab out of the input
* You should *not* see an error message that says something went
  wrong meaning the submission was graded successfully
* Refresh the page and notice the grade is there.
* Verify it is also present in Gradebook

** CNVS-32232 **
* Login as a teacher
* Go into a gradebook that has an assignment that is
  locked down because it is in a closed grading period
* Notice that the grade cells for the assignment are locked
  down (because the submissions fall in a closed grading period)
* Right-click on one of the locked-down cells and select 'Inspect'
* Remove the 'grayed-out' and 'cannot_edit_in_closed_grading_period'
  classes
* Notice the cell is no longer grayed out and you can enter a grade.
* Enter a grade
* Click on another cell.
* You should see an error message that says something went wrong
  and in the Network tab of your dev tools verify the AJAX post
  failed, meaning the submission was not gradeable
* Refresh the page and notice the grade is not there

* Login as an admin
* Login as a teacher
* Go into a gradebook that has an assignment that is
  in a closed grading period
* Enter a grade in a cell that should be due in a closed grading
  period
* Click on another cell
* You should *not* see an error message that says something went
  wrong meaning the submission was graded successfully
* Refresh the page and notice the grade is there.
* Verify it is also present in Gradebook

Change-Id: Ia80e4de626616309c5e9dffb78ed0f9671ad1076
Reviewed-on: https://gerrit.instructure.com/95687
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2016-12-08 21:01:07 +00:00
Jon Jensen 384d8a668e spec: fix flaky spec
protect against a low priority bug that's not relevant to the spec and
we'll likely never fix

Change-Id: I9388659915f041f521accccd62ec01d5e82ffc95
Reviewed-on: https://gerrit.instructure.com/95997
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-11-23 04:59:19 +00:00
Rob Orton 62e71272ad handle user_services accross shards on user merge
fixes CNVS-33046

test plan
 - with user from shard 1 create user service
 - merge into user on shard 2
 - it should not fail

Change-Id: I7a62d26998b3f7c099fc9064b483f22b5540e0b4
Reviewed-on: https://gerrit.instructure.com/94172
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2016-11-01 22:08:05 +00:00
Rob Orton 6534b5ade0 handle communication channels on user merge
refs CNVS-29149

test plan
 - when merging users
 - communication channels should be recorded

Change-Id: I24709e85ced40e4a5c62d62042c464c669e77738
Reviewed-on: https://gerrit.instructure.com/89883
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2016-09-21 18:28:45 +00:00
James Williams b6e887e37e fix enrollment state mismatches caused by user merges
closes #CNVS-31119

Change-Id: Iabeb0d91a2899113e287b17024d3ae704d1a0175
Reviewed-on: https://gerrit.instructure.com/88207
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-08-19 18:29:05 +00:00
Rob Orton 02c34ce525 don't delete conflicting enrollments on user merge
this will instead update the state of the
conflicting enrollments to the best state
additionally we track enrollments on target user
that have changed states

fixes CNVS-27923

test plan
 - have user1 in course as invited
 - have user2 in course as active
 - merge user2 into user1
 - both enrollments will exist
 - enrollment for user2 will be deleted
 - enrollment for user1 will be active

Change-Id: I600011af802e39f9e49719e468afa22f1fdbeffb
Reviewed-on: https://gerrit.instructure.com/74227
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2016-03-30 16:45:01 +00:00
Rob Orton d412fce1d0 don't delete user_observers on user merge
fixes CNVS-27943

test plan
 - have a user with user_observers
 - have a second user observing the same user
 - merge the two users
 - the from user's user_observer should be in the
   database with a deleted workflow_state

Change-Id: I6c265ac61e938b737b63b69ae5bbfe29a7ccb43e
Reviewed-on: https://gerrit.instructure.com/75064
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2016-03-29 17:08:05 +00:00
Rob Orton 573a2b673b create user merge table
fixes CNVS-27291

test plan
 - merge users
 - data should be populated

Change-Id: I5720933484494f582bad4b294a7e6b4edea66b92
Reviewed-on: https://gerrit.instructure.com/72700
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2016-03-09 20:36:09 +00:00
James Williams 2280ee7428 require students to be active to complete requirements
test plan:
* create a future course (but one that isn't restricted)
* create a module with a view requirement for an item
* add a student to the course, they should be able to look around
 but not participate
* confirm that viewing the module item does not fulfill the
 module item requirement

closes #CNVS-26326

Change-Id: Ibe58be1280d377a587e41b45e39ca38168f6093b
Reviewed-on: https://gerrit.instructure.com/71302
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2016-02-08 18:12:47 +00:00