Commit Graph

520 Commits

Author SHA1 Message Date
Rob Orton acdcbf3250 remove the old sis importer
Change-Id: Ifef519776e4358204dd6625acd6cd9f841cd7fcb
Reviewed-on: https://gerrit.instructure.com/152331
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2018-08-17 15:30:27 +00:00
Cody Cutrer 4bd3764ac0 fix bullet/onceler interaction
with nested specs, where the other group has :once stuff, but the
inner does not

Change-Id: I2145cba249b5cbeb82c19ef47037674ac867f44d
Reviewed-on: https://gerrit.instructure.com/159901
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-08-08 16:45:01 +00:00
Cody Cutrer d8f93be62e inherit bullet state in nested before(:once)
Change-Id: I1277d7ba47df8f8aa314125aab7bf32512ea807a
Reviewed-on: https://gerrit.instructure.com/157074
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-07-30 19:22:07 +00:00
Derek Bender 5c010db736 remove dead code and rework comment specs
this patchset removes the unused provisional grade comments, they
weren't used! It also refactors some app code but the majority of the
work was in speed_grader_spec.rb

test plan:
this patchset removes unused code, so we could smoke test speedgrader
for submission comments with moderated grading, but honestly it seems
like overkill if the specs pass.

closes: GRADE-1311

Change-Id: I0b5d3417d3c113b4fa88542284d1e04b2a291be6
Reviewed-on: https://gerrit.instructure.com/155612
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Tested-by: Jenkins
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2018-07-13 16:36:18 +00:00
Cody Cutrer 63d08a7784 spec: fix expectations on nil
Change-Id: I621bab000dbef356bcb1d73461ffd643fc0dc752
Reviewed-on: https://gerrit.instructure.com/156727
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-07-11 15:24:27 +00:00
Cody Cutrer d28dae33ac bullet tweaks
* disable counter cache detection (we don't use it everywhere, because it can
   be a db resource drain)
 * mark objects created via spec factories that bypass AR as newly-created,
   and thus not needing to have associations preloaded on them

Change-Id: Ifc39c87df753fb28f8b094d77a5afe4f90fe8809
Reviewed-on: https://gerrit.instructure.com/156646
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-07-10 15:16:55 +00:00
Cody Cutrer 582421d92b integrate onceler with bullet
copy state over from before(:once) to examples, so that objects
created in the before(:once) don't get tagged as needing to have
been preloaded

Change-Id: I3a2f4fe1b7359f62f55d61a664e6bdcc1499862e
Reviewed-on: https://gerrit.instructure.com/156632
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-07-10 15:16:44 +00:00
Cody Cutrer 6d36e56b12 add bullet
Change-Id: Ia8722fb87d906251faaa710c95fbaeab593c5539
Reviewed-on: https://gerrit.instructure.com/154376
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-07-09 20:18:10 +00:00
Tucker McKnight 72bc724fb3 spec: Move generic consumer tests into pact folder
This also moves the pact_config.rb file into the pact folder.

The line filtering :pact tests has been removed from spec_helper.rb,
since rspec won't try to run them anyway now that they aren't in the
spec folder.

Change-Id: I1d8f27f4f30aa2cdc85e570deb7e0aa2cdb89c66
Reviewed-on: https://gerrit.instructure.com/152144
Reviewed-by: Michael Hargiss <mhargiss@instructure.com>
Tested-by: Jenkins
Product-Review: Tucker McKnight <tmcknight@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
2018-06-04 17:11:00 +00:00
Derek Bender b57cb8cbae add anonymous provisional grades controller
When loading or selecting a student in SpeedGrader, an ajax call is made
to obtain the provisional grade status for that student. This provides a
way to perform this request anonymously.

closes GRADE-1128

test plan
- given an anonymously graded and moderated assignment
- given some students assigned to said assignment
- when visiting speed grader
- then the page loads provisional grades endpoint which can be viewed in
  the dev tools on the network tab. The URL looks like:

  /api/v1/courses/1/assignments/1/anonymous_provisional_grades/status

Change-Id: Ib3d3a7b58fc8fa044d240dee0c1bef08b80384d0
Reviewed-on: https://gerrit.instructure.com/151607
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2018-05-30 17:40:14 +00:00
Tucker McKnight a477cea972 Configuration for i18n Jenkins build
test plan:
- make sure that Jenkins still runs all of the usual tests
- create a Selenium test marked as i18n: true and make sure
  that it gets run in the canvas__selenium-i18n build
- console output for failing tests in the i18n build
  should include which language they failed in

closes CORE-1038
closes CORE-1041

Change-Id: Ie0f2797b704db4fa6aedae3792c0a75b9e83325e
Reviewed-on: https://gerrit.instructure.com/143659
Reviewed-by: Eric Jacobs <ejacobs@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Tucker McKnight <tmcknight@instructure.com>
2018-05-21 21:42:24 +00:00
Michael Hargiss 8568525f24 consolidate contract tests
Test Plan:
  - follow the instructions in spec/contracts/README.md to run
  the live events contract tests locally
  - follow the instructions in
  spec/contracts/service_providers/canvas_lms/README.md to run
  the "Generic Consumer" Canvas API contract tests locally

Change-Id: I316747f53731f411ab82432587596e335c2fd059
Reviewed-on: https://gerrit.instructure.com/149766
Reviewed-by: Tucker McKnight <tmcknight@instructure.com>
Tested-by: Jenkins
Product-Review: Michael Hargiss <mhargiss@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
2018-05-18 22:34:20 +00:00
Rob Orton 777ba1f30d delete scribd
Change-Id: I20d2b6f522a742d220f4263e4d53353bbd996671
Reviewed-on: https://gerrit.instructure.com/146125
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2018-04-10 17:39:52 +00:00
Michael Hargiss 7293ebc942 add quiz lti contract tests for live events
refs QUIZ-4175

Test Plan:
  - qa-cr for now. A subsequent commit will include a comprehensive
    test plan once the Quiz LTI contract test is published.

Change-Id: I2ffe962d8a626994614f3cc904d131e41e3a00b1
Reviewed-on: https://gerrit.instructure.com/145857
Tested-by: Jenkins
Reviewed-by: Mark Grant <mgrant@instructure.com>
Product-Review: Michael Hargiss <mhargiss@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
2018-04-10 14:20:18 +00:00
Simon Williams 9ac6326ff6 spec: cache BrandableCSS.default_variables_md5 before spec runs
Change-Id: I4146172303ccd60375b829750296349f353f4ac4
Reviewed-on: https://gerrit.instructure.com/146356
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2018-04-09 18:57:31 +00:00
James Williams 22472e9428 don't call current_xlog_location in a transaction
Change-Id: I67b0b7b9baa41d76a34f37e2b33541cb10760dc6
Reviewed-on: https://gerrit.instructure.com/145006
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2018-03-28 19:54:41 +00:00
Cody Cutrer 616b2dbb47 drop rails 5.0
Change-Id: Ic374d543a7ba00f660efccb287513c5f80232196
Reviewed-on: https://gerrit.instructure.com/144178
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-03-20 19:50:23 +00:00
Jeremy Neander 760fca6969 anonymize students in speed_grader.json
closes GRADE-941

test plan:
 A. Setup
    1. Select or create
       a. A Course
       b. At least one Student
       c. At least one TA
       d. At least one Assignment with rubric
    2. Enable avatars
    3. As the Student
       a. Give yo'self an avatar
          * Remember to smile
       b. Submit to the assignment
       c. Comment on the submission
    4. As the TA
       a. Upload an avatar
          * No smiles. You are only an assistant.
       b. Comment on the submission
    5. As the Teacher
       a. Avatar: The Last Gradebender
          * Wear that nice sweater you for for your birthday
       b. Grade the submission using the rubric
       c. Comment on the submission
    6. In the Rails console
       a. Load the submission
       b. Assign `abcde` as the submission `anonymous_id`
       c. Save the submission

 B. With AMM Enabled
    1. Enable the AMM feature flag
    2. Visit the course in SpeedGrader
    3. Open the browser network dev tool tab
    4. Refresh to ensure the `speed_grader.json` request is present
    5. View the response to that request

    6. Verify for the enrollments
       a. The student id is absent from the student enrollment
          * `context.enrollments[*].user_id`
       b. The enrollment has an anonymous_id of `abcde`
          * `context.enrollments[*].anonymous_id`

    7. Verify for the submission
       a. The submission has an anonymous_id of `abcde`
          * `submissions[*].anonymous_id`
       b. The submission has no `user_id`
          * `submissions[*].user_id`
       c. The submission history has an anonymous_id of `abcde`
          * `submissions[*].submission_history[*].anonymous_id`
       d. The submission history has no `user_id`
          * `submissions[*].submission_history[*].user_id`

    8. Verify for the student
       a. The student id is absent from the student
          * `context.students[*].id`
       b. The student id is absent from rubric assessments
          * `context.students[*].rubric_assessments[*].user_id`
       c. The student id is absent from submission comments
          * `submissions[*].submission_comments[*].author_id`
       d. The student comment has an anonymous_id of `abcde`
          * `submissions[*].submission_comments[*].anonymous_id`
       e. The student name is absent from submission comments
          * `submissions[*].submission_comments[*].author_name`
       f. The student avatar is the fallback on submission comments
          * `submissions[*].submission_comments[*].avatar_path`
          * `/images/messages/avatar-50.png`

    9. Verify for the TA
       a. The TA id is present on submission comments
          * `submissions[*].submission_comments[*].author_id`
       b. The TA comment does not have an `anonymous_id`
          * `submissions[*].submission_comments[*].anonymous_id`
       c. The TA name is present on submission comments
          * `submissions[*].submission_comments[*].author_name`
       d. The TA avatar is present on submission comments
          * `submissions[*].submission_comments[*].avatar_path`

   10. Verify for the Teacher
       a. The Teacher id is present on submission comments
          * `submissions[*].submission_comments[*].author_id`
       b. The Teacher comment does not have an `anonymous_id`
          * `submissions[*].submission_comments[*].anonymous_id`
       c. The Teacher name is present on submission comments
          * `submissions[*].submission_comments[*].author_name`
       d. The Teacher avatar is present on submission comments
          * `submissions[*].submission_comments[*].avatar_path`

 C. With AMM Disabled
    1. Disable the AMM feature flag
    2. Visit the course in SpeedGrader
    3. Open the browser network dev tool tab
    4. Refresh to ensure the `speed_grader.json` request is present
    5. View the response to that request

    6. Verify for the enrollments
       a. The student id present on the student enrollment
          * `context.enrollments[*].user_id`
       b. The enrollment does not have an anonymous_id
          * `context.enrollments[*].anonymous_id`

    7. Verify for the submission
       a. The submission has no anonymous_id of `abcde`
          * `submissions[*].anonymous_id`
       b. The submission has the student id assigned to `user_id`
          * `submissions[*].user_id`
       c. The submission history has the student id assigned to `user_id`
          * `submissions[*].submission_history[*].user_id`

    8. Verify for the student
       a. The student id is present on the student
          * `context.students[*].id`
       b. The student id is present on rubric assessments
          * `context.students[*].rubric_assessments[*].user_id`
       c. The student id is present on submission comments
          * `submissions[*].submission_comments[*].author_id`
       d. The student comment does not have an anonymous_id
          * `submissions[*].submission_comments[*].anonymous_id`
       e. The student name is present on submission comments
          * `submissions[*].submission_comments[*].author_name`
       f. The student avatar is present on submission comments
          * `submissions[*].submission_comments[*].avatar_path`

    9. Verify for the TA
       a. The TA id is present on submission comments
          * `submissions[*].submission_comments[*].author_id`
       b. The TA comment does not have an `anonymous_id`
          * `submissions[*].submission_comments[*].anonymous_id`
       c. The TA name is present on submission comments
          * `submissions[*].submission_comments[*].author_name`
       d. The TA avatar is present on submission comments
          * `submissions[*].submission_comments[*].avatar_path`

   10. Verify for the Teacher
       a. The Teacher id is present on submission comments
          * `submissions[*].submission_comments[*].author_id`
       b. The Teacher comment does not have an `anonymous_id`
          * `submissions[*].submission_comments[*].anonymous_id`
       c. The Teacher name is present on submission comments
          * `submissions[*].submission_comments[*].author_name`
       d. The Teacher avatar is present on submission comments
          * `submissions[*].submission_comments[*].avatar_path`

   11. Smoke test SpeedGrader

Change-Id: I57806c555b904757876523f4e201cfd8dcd31e61
Reviewed-on: https://gerrit.instructure.com/143287
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2018-03-20 14:35:25 +00:00
Jacob Fugal 171ef86f81 set Attachment.current_root_account during jobs
and rename that suite of methods to make more sense

test-plan: N/A

Change-Id: Iffc520ea55141ac47da669663838a4d3c3d8712c
Reviewed-on: https://gerrit.instructure.com/142486
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2018-03-07 17:18:24 +00:00
James Williams c496ed62e9 use parallel importers to do stuff in smaller jobs
and overall maybe suck a little less

test plan:
* enable the feature "SIS Import Refactor"
* lower the threshold to use multiple parallel jobs
 via "/plugins/sis_import" to a number like 2
* regression tests for sis batch imports

closes #CORE-927 #CORE-928

Change-Id: I91b0bb0cc0e0957cae7897af453ed2d19555303d
Reviewed-on: https://gerrit.instructure.com/140535
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-03-01 20:05:33 +00:00
Shahbaz Javeed a45e7e1eb0 fix error switching courses in student grades page
allow switching between courses that belong to different grading period
groups

closes GRADE-768

test plan:
* Create three terms in an Account, T1, T2 and T3
* Leave T1 without any grading periods
* Create a new Grading Period set (and grading periods) in T2
* Create a separate new Grading Period set (and grading periods) in T3
  such that there is some overlap between the grading periods from this
  set and the one you created for T2

* Create five courses, C1, C2, C3, C4, C5
* Associate C1 and C2 with term T1 so they have no grading periods
* Associate C3 and C4 with term T2
* Associate C5 with term T3

* Create assignments in each of these courses with at least one
  assignment in each grading period
* Enroll one student in all four of these courses
* Grade this student for all the assignments in all courses

* As the student, visit the grade summary page for C1
* Verify you don't see the grading period filter

* From the filters, change the course to C2 and click "Apply"
* Verify you're now seeing the grade summary page for C2
* Verify the URL does not contain a parameter named "grading_period_id"
* Verify this page doesn't show the grading period filter either

* From the filters, change the course to C3 and click "Apply"
* Verify you're now seeing the grade summary page for C3
* Verify the URL does not contain a parameter named "grading_period_id"
* Verify this page now does show the grading period filter
* Verify the grading period filter shows the current grading period i.e.
  one that covers the date/time right now

* From the filters, change the grading period to another one and
  click "Apply"
* Verify you're still on the grade summary page for C3
* Verify the URL now does contain a parameter named "grading_period_id"
* Verify this page also shows the grading period filter
* Verify the grading period filter shows the grading period you selected

* From the filters, change the course to C4 and click "Apply"
* Verify you're now seeing the grade summary page for C4
* Verify the URL now does contain a parameter named "grading_period_id"
* Verify this page now does show the grading period filter
* Verify that the grading period filter shows the same grading period
  it did for the page you just came from (grade summary for C3)

* From the filters, change the course to C5 and click "Apply"
* Verify you're now seeing the grade summary page for C5
* Verify the URL does not contain a parameter named "grading_period_id"
* Verify this page also shows the grading period filter
* Verify the grading period filter shows the current grading period i.e.
  one that covers the date/time right now

Change-Id: If9ceb843fbcc2d5b38f80ef415feaff34a8c96ba
Reviewed-on: https://gerrit.instructure.com/139115
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2018-02-15 17:29:55 +00:00
Rob Orton 5e735cebeb store sis_batch_errors in the db
fixes CORE-324

test plan
 - run a sis import with errors
 - the errors should be included in the api JSON

Change-Id: I97e372a82b565e7bfa01cd9ca0bb66bb67c95723
Reviewed-on: https://gerrit.instructure.com/139071
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2018-01-26 22:08:25 +00:00
Rob Orton 0a4f6861dd handle processing sis batch from an index
this allows us to send different indexes to
multiple workers and process the file in
parallel.

fixes CORE-903

test plan
 - specs should pass

Change-Id: I06d8da8c50476f4a62e0138352ab759b4874f8e8
Reviewed-on: https://gerrit.instructure.com/138814
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2018-01-24 22:03:47 +00:00
Rob Orton b5de0458d9 dots and new lines
test plan
 - specs should pass

Change-Id: Iafc7c9b8ca64f32568e658b600e19c2e6f9045ca
Reviewed-on: https://gerrit.instructure.com/138026
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2018-01-17 16:56:26 +00:00
Cody Cutrer eff1494309 remove deprecate POST /login route
refs CNVS-39869

Change-Id: Iee9571b2e4ea3aae2331fa76ae531d28913f66ba
Reviewed-on: https://gerrit.instructure.com/129108
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-10-16 17:00:02 +00:00
Steven Burnett b48d3260ff create migration for populating terms
Change-Id: I13eddbe900070b8f50ff5c8f6f016daa27ec87d1
Reviewed-on: https://gerrit.instructure.com/128447
Tested-by: Jenkins
QA-Review: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
2017-10-05 20:19:30 +00:00
Felix Milea-Ciobanu ca54bba53c fix admin tools user search date picker
fixes CNVS-35635

test plan:
- go to Account Settings > Admin Tools
- click on the View Notifications tab
- search for users that will result in a large number of results
- click on any of the users
- note that a modal pops up with a date range
- select a range
- note that the results update (assuming there's notification to be
  found) when you click the Find button and the modal goes away
- note that this provides a decent a11y experience

Change-Id: I57db77950a69842249cace0c738025d9ee131b0d
Reviewed-on: https://gerrit.instructure.com/125818
Tested-by: Jenkins
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
2017-09-22 21:27:45 +00:00
Jon Jensen 84d2ffb47c spec: reset MultiCache
fix :allthethings:

Change-Id: I687529a965316c17d0c5c3e6d02282511a016801
Reviewed-on: https://gerrit.instructure.com/125849
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-09-13 00:26:30 +00:00
Cody Cutrer 2cfeeae20e configure multicache via consul
closes CNVS-39230

Change-Id: Iabe72578d52079628a18d2212b40a8a85e273b26
Reviewed-on: https://gerrit.instructure.com/125589
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-09-12 22:49:16 +00:00
James Williams 3855fc4af1 filter out localhost and local ips from canvashttp
test plan:
* use the API to queue a content migration for a course
 with a parameter 'file_url' set to a local url
 (i.e. 'localhost:3000/500.html')
* it should not download the file and allow the file
 to be downloaded on the content migrations page
 for the course

* create a link to a local file
 in a piece of course content (i.e. a page)
* run the course link validator
* it should not actually check if the link exists locally
 or not, but rather always flag the link

closes #SEC-606 SEC-607

Change-Id: I671c017ec93d88446df77d716725fff8874622bc
Reviewed-on: https://gerrit.instructure.com/125118
Tested-by: Jenkins
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-12 20:29:56 +00:00
James Williams 858f509d54 spec: don't recreate roles on every spec
also remove a method that doesn't do anything

should make things faster maybe?

Change-Id: Ie3849b6faa539317338c6f55a0f7be86b8a20c3d
Reviewed-on: https://gerrit.instructure.com/122440
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-11 20:34:30 +00:00
Omar Khan 0536054715 Skip tests that require plugin unless plugin installed
fixes CNVS-36355

Test plan:

- docker-compose build --pull
- docker-compose run --rm web bundle exec rspec \
  spec/{apis,controllers,helpers,initializers,integration,lib,message,\
  middleware,migrations,models,observers,presenters,serializers,views}\
  /**/*_spec.rb

Change-Id: I4220a314dbc2e343dae26e6e522806f4f2666f85
Reviewed-on: https://gerrit.instructure.com/120671
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-07-28 19:30:52 +00:00
Cody Cutrer 142d24bebe spec: remove mocha
also clean up a final few mocha => rspec-mock translations that
were missed

Change-Id: I805c82c84d73099cc396bf9d3a976ebfc972c84c
Reviewed-on: https://gerrit.instructure.com/120680
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-07-27 18:22:39 +00:00
Cody Cutrer 20ff5a9910 spec: mocha => rspec-mocks for api
Change-Id: Ie79aae6502419063835326facd17d9e3c8a77bad
Reviewed-on: https://gerrit.instructure.com/120594
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-07-26 19:25:44 +00:00
James Williams fab27347e9 rails 5.1: enforce new controller/integration spec format
Change-Id: I68cd388bbf7d22d7608a68fbb075493e4a1709fc
Reviewed-on: https://gerrit.instructure.com/120423
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-07-25 21:05:42 +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
James Williams 99edb63c4e spec: rails 5.1: rewrite integration spec format
Change-Id: Ib6f1923b8ff0ec148bfcf5416e3c4d239f5707d5
Reviewed-on: https://gerrit.instructure.com/120243
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-07-25 16:18:52 +00:00
Cody Cutrer c00177b54d fix latent bug in enrollment importer with account associations
fixes CNVS-38298

Change-Id: I4904db19185c764670a5d12f56f2a3df96f9cf60
Reviewed-on: https://gerrit.instructure.com/119870
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2017-07-20 19:01:08 +00:00
Brent Burgoyne bdd84843ca put rich content service behind setting
until rcs is open sourced we don't want it enabled by default for
open source users.

closes CNVS-38092

test plan:
- disable rcs feature flag
- rcs should be off everywhere
- from the rails console run:
  - Setting.set('rich_content_service_enabled', 'true')
- send SIGHUP to your rails process(es)
- rcs should be on for eportfolios and wiki pages
- enable rcs feature flag
- rcs should be on everywhere

Change-Id: Ibca84b7183dd0344b73433024b47e9948cbab3e8
Reviewed-on: https://gerrit.instructure.com/118223
Tested-by: Jenkins
Reviewed-by: brian kirkby <bkirkby@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2017-07-10 19:24:46 +00:00
Brent Burgoyne 179bf7c5fc change rcs feature flag text, remove first 2 flags
the first two rcs flags have been enabled for all hosted accounts
for a long time. we are changing the lable of the 3rd flag and removing the
first two to provide better clarity as we enable the 3rd flag for
accounts.

closes CNVS-37261

test plan:
- go to the feature flags page for an account
  - there should only be one rcs flag with an updated message
- ensure that flag is disabled
- editing wiki pages should still have the new sidebar
- high risk area (i.e. quizzes, assignments) should not have the new
  sidebar
- enable the flag
- all editors should be using rcs with the new sidebar

Change-Id: I689eb9ebaf4d3a5fc111c231d13861cc28ae5d87
Reviewed-on: https://gerrit.instructure.com/116542
Tested-by: Jenkins
Reviewed-by: brian kirkby <bkirkby@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2017-06-27 18:39:16 +00:00
Cody Cutrer 75c7538888 drop rails 4.2
also, allow rails 5.1

Change-Id: If480c2a2c01a7578552dc70f4bdcf3a46df40e7b
Reviewed-on: https://gerrit.instructure.com/115654
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
2017-06-27 15:29:51 +00:00
Landon Wilkins 193a87afc0 da licença part 60
add consistent license headers to all source files

Change-Id: Ibaf8cf457ad92c6a1108e9254786d1f5f18b5662
Reviewed-on: https://gerrit.instructure.com/110311
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-05-01 21:20:40 +00:00
Jon Jensen be84615841 bump simplecov, fixes SD-2056
test plan:
see coverage in previous rspec/selenium builds, same numbers as before

Change-Id: I331bf5102914da00a5d350f32b74b4bc9d49c5f8
Reviewed-on: https://gerrit.instructure.com/106895
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-04-04 18:06:25 +00:00
Jon Jensen 3141bcc65a spec: be less aggressive about resetting the test db, refs SD-2289
should speed up local testing a lot, and jenkins a little bit (mainly the
rerun phase right now). in a subsequent test repo commit we'll speed up
jenkins a lot, as we'll do a truncate right after we migrate, which means
the cost will be incurred in the post-merge build and not the patchset
build

* don't double truncate one of the shards
* don't randomize sequences unless an env var is set
* don't truncate unless it looks like we've never truncated
  (there are Accounts)
* remove some unnecessary switchmanning in rspec-queue

[ci verbose]

test plan:
1. run a spec on a freshly created/migrated test db
   1. confirm you see "truncating all tables"
   2. confirm you do not see "randomizing db sequences"
2. run the spec again
   1. confirm you do not see "truncating all tables"
   2. confirm you do not see "randomizing db sequences"
3. run the spec again with RANDOMIZE_SEQUENCES=1
   1. confirm you do not see "truncating all tables"
   2. confirm you see "randomizing db sequences"
4. in jenkins land on the initial run
   1. confirm you see "truncating all tables"
   2. confirm you see "randomizing db sequences"
5. in jenkins land on a rerun
   1. confirm you do not see "truncating all tables"
   2. confirm you see "randomizing db sequences"

Change-Id: Id24026e70afaa35abef4d02249be2c9ba27f1f21
Reviewed-on: https://gerrit.instructure.com/106043
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-03-23 19:36:56 +00:00
Cody Cutrer ce21af8ecf rails 5: find and fix lots of deprecation warnings [ci verbose]
refs CNVS-34843

Change-Id: Idd523c2a7c37325381d590f1ee70c406ace2a459
Reviewed-on: https://gerrit.instructure.com/105033
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-16 16:03:51 +00:00
Cody Cutrer 1b411ccef9 rails 5: silence another spec deprecation warning
Change-Id: Ic1bee4948715c62389845b11426e5d1d56d02dad
Reviewed-on: https://gerrit.instructure.com/104947
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-13 23:04:53 +00:00
Ryan Shaw 5b88629fe0 Remove RequireJS support
closes: CNVS-31785

test plan:
all builds should pass

Change-Id: I2925934692a3d2f115f1289d7b50cb72d8cb907f
Reviewed-on: https://gerrit.instructure.com/104492
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2017-03-13 22:10:23 +00:00
Cody Cutrer fb67a12ca0 rails 5: improve some deprecation warnings
* completely hide a spec one that we can't (easily) address
 * fix the blame assignment of others to not point at generic
   monkey patches, instead of the actual caller

Change-Id: I76ad1f871b14104d5b73141210bd9069da43b033
Reviewed-on: https://gerrit.instructure.com/104919
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-13 20:36:45 +00:00
Cody Cutrer 0fa7d9710b spec: don't silence deprecation warnings at all
Change-Id: Iac93975e9a09bf19afadaa9dc770d19f1d65b280
Reviewed-on: https://gerrit.instructure.com/104759
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-13 19:12:21 +00:00
Cody Cutrer a99d2a3bdc spec: don't allow raise_error with no arguments
most of these are simple fixes, but there are a few where the spec has
actually been broken due to underlying API changes, that were masked
due to the generic raise_error matcher

fixes CNVS-35542

Change-Id: I982e7ab9af59101b79fdf6b2e0816b374a6a6d5b
Reviewed-on: https://gerrit.instructure.com/104750
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-03-10 21:34:37 +00:00
Cody Cutrer 186e6c43cc spec: don't hide deprecation warnings under rails 4.2
we want to fix them all before we go to rails 5

Change-Id: Ib530df5b2b0bf415c6c2c58bbb1fe6d8c8f6ce01
Reviewed-on: https://gerrit.instructure.com/104753
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-10 20:02:12 +00:00
Cody Cutrer bd79971513 spec: drop compare_json
it had critical bugs where mismatched keys would bet let through. so
instead just compare directly; rspec has good hash and array diffing nowadays,
and we just need to call as_json on a few things

Change-Id: I6147e8c988c1dc4f4e3224dc6a4e51e51b27e5f3
Reviewed-on: https://gerrit.instructure.com/104402
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-03-08 17:56:50 +00:00
Jon Jensen ff8ffd9a14 spec: refactor error page-y stuff, refs SD-1815
reimplement it using formatters. notable changes:

1. the index page has separate sections for "Initial", "Rerun 1", etc.
2. you now get error pages for before(:all) failures
3. you now get error pages for non-selenium failures
4. you now get links to pages for failures prior to the current one
5. in addition to not capturing screenshots/videos on too-many-failures,
   we now stop making error pages if there are too many, so that we don't
   fill up the workspace on mass badness

test plan:
1. see build in repo-who-shall-not-be-named

Change-Id: I54f065f1515f2b639b3f90b471a19e434a17aece
Reviewed-on: https://gerrit.instructure.com/102002
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-02-16 19:48:56 +00:00
Jon Jensen fb3966a62d Great Expectations, fixes SD-2065
Find/fix/prevent weird stuff we are doing (or not doing) with `expect`.

Chapter I:

    "I have been bent and broken, but - I hope - into a better shape."

Disallow `expect`s in a `before`. `before` is by definition before the
test, so it's not the place to be asserting anything. You can of course
still set up mocks there.

Chapter II:

    "Take nothing on its looks; take everything on evidence. There's no
    better rule."

Ensure every `expect` actually runs. i.e. it needs `to` or `not_to` in
order to actually do anything.

Chapter III:

    "Ask no questions, and you'll be told no lies."

In selenium land, ensure every spec has at least one expecation. In
regular rspec land we just warn to stderr, but we may get more strict
in the future.

Test Plan: Specs

Change-Id: I5fc353ee8171e5191853d45f42ae42478f9220b4
Reviewed-on: https://gerrit.instructure.com/101224
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-02-13 17:25:09 +00:00
Cody Cutrer e04667a89f rails 5: change alias_method_chain to prepended modules
fixes CNVS-33377, CNVS-33697, CNVS-33699, CNVS-33700, CNVS-33701

Change-Id: I4ed1340a3b1472200ac59ddc4c0f7111e9418db0
Reviewed-on: https://gerrit.instructure.com/101509
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
2017-02-10 19:42:29 +00:00
Cody Cutrer 533b1868f8 rails 5: fix assigns in view specs
refs CNVS-34867

we need to get rid of our old monkey patch of assigns, but allowing
the default behavior of all ivars transfer over is a nightmare with
our factories. so block that behavior, and target to just view specs
a new shim to use the correct way to have explicit assigns

Change-Id: Ifa529f63405d278d3d0dfb09cc66febbeb5be5c3
Reviewed-on: https://gerrit.instructure.com/101562
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-02-10 19:17:28 +00:00
Jon Jensen c9c86901b7 spec: rework error backtrace pruning
make it Just Work™ for standard exceptions thrown from standard places

also make them pretty on the seleniumfailures page

test plan:
1. see test build w/ failures
2. behold the nice backtraces in the output and on the error pages

Change-Id: Iaa6c57e642bc12d562eb5f3df7894dcb27707ccd
Reviewed-on: https://gerrit.instructure.com/101368
Tested-by: Jenkins
Reviewed-by: Alex Boyd <aboyd@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-02-08 21:32:19 +00:00
Cody Cutrer ef6dacb23e rails 5: don't fail every spec under the sun
Change-Id: I0a67a462cd802cb5620be4ccf78c1a6e9b61faf0
Reviewed-on: https://gerrit.instructure.com/101398
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-02-08 17:28:47 +00:00
Cody Cutrer da31890cdc ruby 2.4: bump webmock
Change-Id: I7cdce76243b2eff3752509d86072dd23fc80f811
Reviewed-on: https://gerrit.instructure.com/101009
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
2017-02-02 22:53:03 +00:00
Jon Jensen cf87cc08b8 spec: when using test-queue, don't truncate tables in main process
we're going to do it again after fork anyway, so it's redundant

Change-Id: Iede3160a8daf63869a42505bbec0496c12336912
Reviewed-on: https://gerrit.instructure.com/100875
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-02-01 17:06:42 +00:00
Jon Jensen a743278b6b spec: intelligent spec time limits, fixes SD-1936, SD-1937
the idea is to prevent people from making specs slower, while
grandfathering in existing specs

basically:
1. if it's a spec we've seen before, don't let it run much slower than
   usual ... basically however long it took in the post-merge, with a
   very generous fudge factor
2. if it's a new spec in this commit, enforce an aggressive timeout (10
   sec, but configurable via env var)
3. regardless, don't let any spec take more than 60 seconds (not new, but
   now configurable via env var) ... since local testing typically won't
   have stats available, this will come into play

Change-Id: I4d8de97ccbef324ffde5b04de78db39e915b7e8a
Reviewed-on: https://gerrit.instructure.com/100379
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-01-27 19:17:23 +00:00
Cody Cutrer 6beba043bc fix some ruby 2.4 deprecations
the thread_safe gem has deprecations too, but they'll require Rails 5.1
until they're fixed (when both activesupport and tzinfo no longer
depend on it)

Change-Id: Ic53839d911ba8ed4d463d17f9dd7207673510f3a
Reviewed-on: https://gerrit.instructure.com/100499
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-01-25 21:53:37 +00:00
Cody Cutrer 1f03606627 aws sdk v2 support for attachments
closes CNVS-33615

test plan:
 * upload and download files using S3
 * submit an assignment
 * do an SIS import with parallel
 * do a course copy
 * export and import a course
 * upload some custom css file in theme editor
 * test a canvadoc and crocodoc preview

Change-Id: I9145b39728938e7e5903d23c4a4598fc8df4ef45
Reviewed-on: https://gerrit.instructure.com/93002
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
2017-01-24 21:09:14 +00:00
Jon Jensen d415fe3109 spec: exempt pry from spec timeouts
Change-Id: I12c6360c72316e546f47589c28ce5e7cebf2172b
Reviewed-on: https://gerrit.instructure.com/100293
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-01-24 17:32:35 +00:00
Jon Jensen 5b544a57cf spec: clean up spec_helper.rb a little bit
baby steps

Change-Id: I70220768acaea672f68c8f33801cd69e10328be5
Reviewed-on: https://gerrit.instructure.com/100276
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-01-24 17:32:32 +00:00
Simon Williams e6446e3279 spec: remove bullet_instructure gem
it was unused and our fork has diverged from the main gem.  I'd still
love to see bullet get into our linting, but we need to start over on
the approach

refs CNVS-34084

test plan: specs should pass

Change-Id: I46c211e4a21b6234d0e3a4fee1ac91acf2d3c5d0
Reviewed-on: https://gerrit.instructure.com/98789
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
2017-01-10 19:45:39 +00:00
Shahbaz Javeed 06ddfef3d3 bring back shoulda-matchers and associated specs
The monkey-patch is necessary to allow shoulda-matchers > 3.0.1
to work with active_model-better_errors.  This essentially
provides a working grep implementation to ErrorMessageSet

test plan:
* Ensure specs pass

Change-Id: I1e4b490e98803a62293702fa38951f3dce5fcde4
Reviewed-on: https://gerrit.instructure.com/98513
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
QA-Review: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
2017-01-06 22:28:27 +00:00
Nathan Mills e961d7db54 refactor the tii lti methods
refs: PLAT-1857

test plan:

-regression test the tii lti tool

Change-Id: I68713caa52c8f1defd275415bcedc68601604d32
Reviewed-on: https://gerrit.instructure.com/98147
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
2017-01-06 20:59:32 +00:00
Jon Jensen cfc2ef675f remove i18nema and syck
fixes CNVS-34164

test plan:
 * basic smoke test that translations still work

Change-Id: Ia88fc88de8b52aeaa92b65ea43b93eef5adb1dcc
Reviewed-on: https://gerrit.instructure.com/95065
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2017-01-06 19:34:55 +00:00
Jon Jensen 282ee6de70 spec: lower spec timeout, fixes SD-1810
we'll lower this even more in the future, baby steps

typically the lowest selenium spec is 40 sec,
the slowest non-selenium spec is 30 spec

Change-Id: I4bb3a424f7ad44038f980bd8269ae6d1974dc795
Reviewed-on: https://gerrit.instructure.com/98151
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-20 16:57:26 +00:00
Jon Jensen c8972d3331 spec: ensure we capture all failures, fixes SD-1851
do this in the outermost around so that any kind of failure gives us a
screenshot page

test plan:
1. see various intentional failures captured on patchset 2

Change-Id: I5aa9f6035ecf327c9a585aafacaa820b10208753
Reviewed-on: https://gerrit.instructure.com/97672
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-15 01:17:30 +00:00
Jeremy Neander 8eb038007d protect due dates in closed grading periods
This ensures that due dates cannot be set or changed in a way
which puts them into, takes them out of, or adjusts them within a
closed grading period.

closes CNVS-32489
closes CNVS-33037

test plan:

* Test the following endpoints:
  * POST     /courses/:course_id/quizzes
    (quizzes/quizzes#create)
  * PUT      /courses/:course_id/quizzes/:id
    (quizzes/quizzes#update)
  * POST     /api/v1/courses/:course_id/quizzes
    (quizzes/quizzes_api#create)
  * PUT      /api/v1/courses/:course_id/quizzes/:id
    (quizzes/quizzes_api#update)
  * POST     /api/v1/courses/:course_id/assignments
    (assignments_api#create)
  * PUT      /api/v1/courses/:course_id/assignments/:id
    (assignments_api#update)

* A teacher cannot:
  * create a quiz/assignment
    * with a due date in a closed grading period
    * with an override due date in a closed grading period
    * with a nil due date when the last grading period is closed
    * with a nil override due date when the last grading period
      is closed
  * change the due date on a quiz or assignment
    * due in a closed grading period
    * with an override due in a closed grading period
    * to a date within a closed grading period
  * change the due date of an override
    * due in a closed grading period
    * to a date within a closed grading period
  * unset (nullify) the due date when the last grading period is
    closed
  * unset (nullify) the due date of an override when the last
    grading period is closed
  * delete (by omission from parameters) an override due in a
    closed grading period

* A teacher can:
  * create a quiz/assignment with a due date in an open grading
    period
  * change the quiz/assignment due date when the assignment is
    only visible to overrides
  * change the quiz/assignment due date when not within a closed
    grading period
  * change the quiz/assignment due date when set to the same
    value

* An ADMIN does not have these restrictions.

Change-Id: I0da260e831784e7b6d0f6e5a35c43d6ecff9e977
Reviewed-on: https://gerrit.instructure.com/93806
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2016-11-18 23:50:24 +00:00
Jon Jensen 82eac2107c spec: make specs resilient to pre-existing records, refs SD-1570
in jenkins-land we've historically used db snapshots so the db will be
empty. but if you `rake db:migrate` your test db, you'll have things like
default accounts, notifications, etc., which can break certain specs

Change-Id: I175e651d1b50671e630dc0181d1c4d25e78abe97
Reviewed-on: https://gerrit.instructure.com/95249
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2016-11-15 20:13:19 +00:00
Jon Jensen 57179c8612 spec: prevent creating lots of (slow) enrollments
fixes SD-1653

Change-Id: I297c0aba56f0acc501f48e2de3548c93e9934fd3
Reviewed-on: https://gerrit.instructure.com/92747
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2016-10-26 21:32:07 +00:00
Jon Jensen dbce888c45 spec: speed up some specs w/ lots of enrollments
reduce runtime of these specs >75% (130sec -> 30sec)

Change-Id: I34f1d53609eed87201d16708a8b3bdca8cd6c7ec
Reviewed-on: https://gerrit.instructure.com/93141
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-18 23:44:35 +00:00
Jon Jensen 5fd9010263 spec: consistently require webmock
stub out external stuff in specs. once we do so in plugins, we can
change this to `WebMock.disable_net_connect! allow_localhost: true`

previously it would either allow or disallow requests across the board,
depending on which spec files were loaded, which caused flickering
failures.

Change-Id: I1da58596dc7b781710ed615dd700850d3fea555a
Reviewed-on: https://gerrit.instructure.com/92634
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 21:20:25 +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
Jon Jensen 761d292960 spec: allow selinimum to run outside of bundler, refs SD-1557
for great speed

test plan:
1. the selinimization attempt on this commit should not asplode (currently
   asplodes in jenkins due to a newer version of aws-sdk getting
   activated). note that it won't get selinimized, cuz spec_helper changed
2. selinimum capture should work locally (and on the post-merge of this
   commit)

Change-Id: I89ca259435364b8820646f1b0fd74d92eb1fca1e
Reviewed-on: https://gerrit.instructure.com/91049
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-09-22 18:21:48 +00:00
James Williams 57acd57814 use all the enrollment states as a "source of truth"™
drop the logging columns and go for it

try to replace as many areas as possible with scopes using
 the enrollment states table, give that it is kept nearly
 up-to-date and should be faster than instantiating all
 over the place

test plan:
* regression test key areas of canvas, particularly
 course access
* hold butt

closes #CNVS-30884

Change-Id: Ifa8a663522674eb7856c50de43be50966a086a0f
Reviewed-on: https://gerrit.instructure.com/87339
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-09-14 20:29:58 +00:00
Neil Gupta 21c004d6c5 TII helper sekret endpoint
This adds site admin only endpoints for support to fix TII errors

Fixes CNVS-30959

Test plan:
* access /api/v1/support_helpers/turnitin/shard to make sure it kicks
off a new shard fixer job. It should send you a success email.
* make sure that endpoint is only accessible when you are logged in
as a site admin user

You can also edit some of your existing submissions' turnitin_data to
create broken submissions and then test the appropriate fixer.

Change-Id: Ic8ea65b33191825deb4fc693ef994c58bc7aa811
Reviewed-on: https://gerrit.instructure.com/87302
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2016-09-06 15:14:38 +00:00
Jon Jensen b0885dbefb spec: fix brittle spec(s)
fixes a spec ordering failure when running:

 rspec ./spec/controllers/conversations_controller_spec.rb:516:526

Change-Id: Id677134a4075039093cda1d30214db5ee7a43c04
Reviewed-on: https://gerrit.instructure.com/89244
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-08-30 23:33:49 +00:00
Jon Jensen 977029a9c3 spec: more shared db support and BlankSlateProtection, refs SD-1422
make sure all specs are transactional, and that no data setup happens
outside of transactions. this will allow us to use a single test db
for multiple runners.

add a shared_db hint for one spec so that rspec-queue gives it its own
database.

Change-Id: Ifd54b707edfb39970371b78924cf01473dce3a9c
Reviewed-on: https://gerrit.instructure.com/88591
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-08-24 17:04:49 +00:00
Jon Jensen 19bf7c867f spec: remove unused code
this hasn't been necessary since after_transaction_commit was extracted

Change-Id: I1ac618c957aef1725949a2ede23fa1107de9c13c
Reviewed-on: https://gerrit.instructure.com/88566
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-08-23 21:51:50 +00:00
Landon Wilkins ef4149106a spec: add logging for simplecov starts
Change-Id: I79536048444489a30e7348c2a3a389345a303907
Reviewed-on: https://gerrit.instructure.com/88449
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-08-22 22:12:33 +00:00
Jon Jensen aeb4c655ec spec: remove unused helpers
also fix GC regression around create_temp_dir!

Change-Id: Ibe60fb9cd7d5a455d7e3643e3d5f68ca0ad9a96e
Reviewed-on: https://gerrit.instructure.com/88441
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-08-22 21:39:02 +00:00
Jon Jensen 9179e3fff5 spec: simplify setup/cleanup logic, refs SD-1422
* ensure appropriate things are set up before recording and each spec
* remove various unused cleanup-y things
* make BlankSlateProtection.disable restore the previous state

one plugin still needs some massaging around transactions/etc., then we
can turn on BlankSlateProtection and force transactional tests across the
board

Change-Id: I9aacda0f80f94af4dff3ac30c65b5ccd22e7d47d
Reviewed-on: https://gerrit.instructure.com/88397
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-08-22 20:55:52 +00:00
Jon Jensen 6045f92a3a spec: tighten up blank slate protection some more
refs SD-1419

also make a tweak to facilitate multiple test processes sharing a db

Change-Id: I1f429538213463b2a025c561523a0c0c782aa8e5
Reviewed-on: https://gerrit.instructure.com/87861
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-08-16 18:20:53 +00:00
Landon Wilkins 78ee569ba6 require_relative for coverage_tool
our CI now performs some loading magic that
breaks the regular require

test plan:
* verify no explosions for:
  COVERAGE=1 bundle exec rspec ./spec/models/user_spec.rb

Change-Id: Ie6c095ce114ae28eeca2d65850fcb1fbc254a450
Reviewed-on: https://gerrit.instructure.com/87698
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2016-08-12 20:38:18 +00:00
Jon Jensen c2bd6be6a6 spec: fix BlankSlateProtection issue
make sure vanilla canvas (no plugins) doesn't blow up when starting up the
thin server

Change-Id: I072a995af4e03bb38cb6edb2355b6fac00710a05
Reviewed-on: https://gerrit.instructure.com/87413
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2016-08-10 19:58:00 +00:00
Jon Jensen 8c51f15448 spec: remove unused method
Change-Id: I2cda544c0d5c8054113d7b3c5f9f3f5089d99d65
Reviewed-on: https://gerrit.instructure.com/87279
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2016-08-09 22:08:49 +00:00
Derek Bender c62274c4a6 add grading period set endpoints
- fix spec_helper require
 - the API for GradingPeriodController now only accepts
   requests with the correct mimetype of 'application/json'

refs: CNVS-27104

Once dev/grading-periods-update lands in master we
need to move the title presence validation from the
controller to the model.

test plan:
 - ensure that the new actions in GradingPeriodSetController
   are available via the API:
   - GET    /accounts/1/grading_period_sets
   - POST   /accounts/1/grading_period_sets
   - PATCH  /accounts/1/grading_period_sets/1
   - DELETE /accounts/1/grading_period_sets/1
 - the json data for POST/PATCH looks something like:

    {
      "grading_period_set": {
        "title": "A Grading Period Set Title"
      },
      "enrollment_term_ids": ["1"]
    }

 - only users with permissions to the root account may
   create GradingPeriodGroups attached to an EnrollmentTerm.
 - if a user on a sub account is supplied, the api will
   return unauthorized.

Change-Id: I0aa555fbd8d0b803fa7e97a1989de57b9eaf52fe
Reviewed-on: https://gerrit.instructure.com/78078
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2016-06-01 13:39:33 +00:00
Landon Wilkins 0cc14da2cd turn on Timecop safe_mode, fixes SD-1019
test plan:
* specs pass

Change-Id: Ib2be7276f15880de73228ed4a3ce7047bca8678b
Reviewed-on: https://gerrit.instructure.com/78742
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-05-16 18:59:40 +00:00
James Williams 8efaeeb3a4 spec: cleanup temp directories afterwards
Change-Id: I31d9c548faed196a970a3f24e1b251a87b08127b
Reviewed-on: https://gerrit.instructure.com/78451
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-05-03 12:46:59 +00:00
Nathan Mills 28fa95ef9e fix problems with lti2 and assignments
fixes PLAT-1371

test plan:

create an LTI 2 assignment
it should launch

create and LTI 2 assignment that is a module item
it should launch

Change-Id: I9cb77477a5d8eec7742c90e5a3c501fc9b6cdce6
Reviewed-on: https://gerrit.instructure.com/76300
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-04-25 20:22:36 +00:00
Rob Orton d236166297 drop mysql support and gem
test plan
 - specs should pass

Change-Id: Ib3f102b53d947198625e3118820d22e77a005dd6
Reviewed-on: https://gerrit.instructure.com/77249
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2016-04-19 19:55:55 +00:00
Jon Jensen fc46b69121 selinimum 3: autoload magic, fixes SD-1018
Make most autoloadable files selinimizable. That means that you can edit
most models/helpers/gems/lib files and only have the relevant selenium
specs run \o/

How does it work?
=================

As with the existing selinimized stuff (controllers/views/css/js/etc), we
capture the dependencies of each spec file in a post-merge build. To
accomplish this, we hook into Rails' autoloading mechanism and give it
some hide/restore magic. This way we can hide all autoloaded constants
from one spec file to the next (technically, top-level example group).
As specs run, constants are loaded (or restored) via autoloading, and
we track all of them.

Then on your patchset build, we synthesize this information with the list
of files you changed. If all files are selinimizable, we can safely run
just a subset of specs.

What things are still not selinimizable?
========================================

* config/* (including routes.rb)
* models loaded when the app starts up (~20%, biggies like User, etc.)
* observers and their models (cuz they really like to load :allthethings:)
* things that are `require`d (`require_dependency` is a-ok though)

Test Plan:
* Normal patchset builds should pass
* Build with capturing enabled should pass and publish to S3
* Test commits based on this one should:
  1. Be correctly selinimized if limited to captured autoloads, etc.
  2. Not be selinimized otherwise

[selinimum-capture]

Change-Id: I04cea1fa6055d201d72d210a3e9bd770f26769a5
Reviewed-on: https://gerrit.instructure.com/76931
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-04-16 17:00:29 +00:00
Jon Jensen 66ac9ba1c7 spec: ensure example groups don't leave garbage behind
since this adds some overhead, it's opt-in. currently passes on master, and
will be turned on for post-merge builds (but not patchsets)

Change-Id: I645fcf56f4bc7ca5fdf401e4c6cb58547f3d71d8
Reviewed-on: https://gerrit.instructure.com/73781
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-03-29 22:19:04 +00:00
Cody Cutrer b469b83f64 protect against inadvertent use of potentially dangerous redis commands
test plan:
 * try Rails.cache.instance_variable_get(:@data).keys, or any other way
   you can think of to try and get all keys (or flushdb or other scary
   stuff) from redis
 * it should raise an error
 * Shackles.activate!(:deploy)
 * try again
 * it should work

Change-Id: I57772df3851fd14b6a46a56c9cd8ef6ddce015e3
Reviewed-on: https://gerrit.instructure.com/73940
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-03-15 15:02:07 +00:00
Cody Cutrer ecf89e25c7 spec: don't form invalid SQL when no tables exist
Change-Id: I3400418bc98efd5208a6cd06539f3d4cb0ccb66e
Reviewed-on: https://gerrit.instructure.com/74160
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-03-10 23:28:08 +00:00
James Williams 0777cba946 remove differentiated assignments feature checks
test plan:
* basic regression test of assignment overrides

closes #CNVS-27549

Change-Id: Ie463848b3831087efb3f9ec762dca6264055ee76
Reviewed-on: https://gerrit.instructure.com/73139
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2016-03-07 18:44:46 +00:00