Commit Graph

8 Commits

Author SHA1 Message Date
James Williams a8fc7bbcff fix favoriting for cross-shard logins
- fix id transposition for unfavoriting
- don't keep the favorite courses cache after saving
- reload the user if they're a shadow so we get the primary
 updated_at

closes #ADMIN-1467

Change-Id: I97ff4937bdb009e2576e2201a8a01f40a8668bf4
Reviewed-on: https://gerrit.instructure.com/165076
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-09-20 19:29:12 +00:00
Derek Bender 3865d53ef3 add submission comment pdf exporter
scores are shown, not grades.

closes: GRADE-1457

Test Plan:
  Note: the new endpoint is of the form:

    /submissions/:submssion_id/comments.pdf

 - given a submission with many submission comments
 - given SpeedGrader page
 - when the link for Export Submission Comments is clicked
 - then a pdf of submission comments is displayed

 - given a user that cannot Read Grades
 - when accessing a pdf url
 - then the response is unauthorized

 - given a user that cannot Read Comments
 - when accessing a pdf url
 - then the response is unauthorized

 - given an assignment that is anonymous
 - when on the SpeedGrader page
 - then the link for Export Submission Comments is not displayed
 - then hitting the pdf url returns unauthorized

 - also test with group assignments

Change-Id: I529fe170a3de6f8a1c8f28ae20a3346c5676a97e
Reviewed-on: https://gerrit.instructure.com/158888
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
Tested-by: Jenkins
2018-08-23 00:43:26 +00:00
Cody Cutrer 4990da6779 prep for mocha removal
* ENV['NO_MOCHA']=1 to disable mocha
 * switch several core mocks to rspec-mocks
 * fix Great Expectations to allow mock expectations
   in before blocks

Change-Id: Icee8dee7f01234d2dd4e26ac13562fe9fc93665a
Reviewed-on: https://gerrit.instructure.com/119984
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2017-07-25 17:37:13 +00:00
Spencer Uresk d899c22074 Specify user and pseudonym when sending logged_in event
fixes DS-1714

Currently, the logged_in event does not send user information.
This change explicitly passes in the user and pseudonym when
sending the logged_in event, which merges them into the context.

This change also adds the pseudonym's account id and sis id.

Test Plan:
- Login to Canvas
- View live event data, ensure that user_id and user_login
exist in the payload.
- Ensure user account id and sis id are in the attributes.

Change-Id: If720a2b8094de558f79cbae42a7c5156ad86c556
Reviewed-on: https://gerrit.instructure.com/110289
Tested-by: Jenkins
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Spencer Uresk <suresk@instructure.com>
2017-06-06 21:37:29 +00:00
Landon Wilkins 0ce4a23f58 da licença part 46
add consistent license headers to all source files

Change-Id: If9d3b01addc4fd9c2977bf2402dda57ec622e72f
Reviewed-on: https://gerrit.instructure.com/110151
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:56:22 +00:00
Jon Jensen f55776d146 spec: fix spec that fails the first run on most builds
also prevent session stubbing in before(:once) blocks and remove lots
of unnecessary stubbing

note that while session stubbing is also unnecessary in controller/api
specs (just need @user to be set), delaying removal of thay to another
commit (we might want tweak it to actually use session stubbing or
something otherwise explicit and less magical than @user)

Change-Id: Iea1792c960ad32090bc4644febc87e1d3651f550
Reviewed-on: https://gerrit.instructure.com/96791
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-12-06 00:07:13 +00:00
Jon Jensen da62f561ea spec: move factories off of Object
it's kind of crazy that you could do stuff like:

  "lol".user

i don't know why we didn't do this years ago ¯\_(ツ)_/¯

Change-Id: I0d3f8644729382d6bee889352557792bc353927c
Reviewed-on: https://gerrit.instructure.com/92583
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-10-12 02:02:44 +00:00
John Corrigan fcb87dc336 move factories out of spec_helper
This is the first step to get us moved over to factory girl for test
factories. Gergich (rightly) has a lot to say on this, because I've
moved around a lot of scary looking code, but I am hesitant to spend
much time on fixing it here, since the end goal would be to rewrite most
all of the factory logic in factory girl anyway. Any feedback is good
feedback!

Change-Id: Id0da1099e98d4ac79c6bf1e1e8808d6e7ea43596
Reviewed-on: https://gerrit.instructure.com/57853
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: John Corrigan <jcorrigan@instructure.com>
Tested-by: John Corrigan <jcorrigan@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2015-07-16 15:29:29 +00:00