Commit Graph

7 Commits

Author SHA1 Message Date
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
Benjamin Porter 5a975d407f Include pdfjs in preferred_plugins array
Instead of sending a separate param to canvadocs for pdfjs as
a preferred plugin, just put it in the preferred_plugins array (which
used to be called preferred_renders)

Refs CNVS-30582

Test Plan:

    - This is very difficult to test manually, particularly without
      changing any code.  The reason for this is that canvadocs doesn't
      currently do anything with the pdfjs preferred plugin so you can't
      just check for that behavior.  However, this is something you can
      do even tho it isn't ideal (and this is how I tested this patch in
      development):
      - get canvas working with a canvadocs instance on which you can
        modify code.  By modifying the canvadocs instead of the canvas,
        the integrity of this patch is maintained for test purposes.
      - In the canvadocs session controller
        (app/controllers/session_controller.js), add a log statement to
        display what comes in in the body of the request.  Something
        like:
        - console.log('Request body: ')
        - console.dir(req.body)
      - Submit an assignment to a course as a student.
      - As a teacher, open speedgrader from that assignment.  This will
        cause a new canvadocs viewing session to be created.
      - In the console output of the canvadocs instance, see that the
        body did not include a preferred_plugin of pdfjs.
      - Toggle the feature flag to enable new annotations.
      - Repeat opening speedgrader but this time observe that the body
        includes pdfjs in the list of preferred_plugins.

Change-Id: Ie3e16e1331fcdd757e96888f033e8341e7d6a0bc
Reviewed-on: https://gerrit.instructure.com/86549
Tested-by: Jenkins
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2016-08-03 03:07:50 +00:00
Benjamin Porter 07687bcbd1 Add feature flag for canvadocs preferred plugin
When the new canvadocs annotation stuff is ready, we want to be able to
selectively turn it on to slowly roll it out.  This adds a feature flag
to the course that allows the new annotations to be enabled by course.
There is also an account-level flag that allows the feature to be turned
off globally per account, turned on, or simply "allowed" which delegates
to the course.

Refs CNVS-26668

Test Plan:

    - Open up the account settings and observe that there is a feature
      flag called 'New Annotations'
    - See that the feature flag can be either Off, Allowed, or On
    - Inside a course belonging to the account, see that there is
      a feature flag for New Annotations that can be toggled on/off when
      the account level setting is 'Allowed', or is Off when the account
      is off or On when the account is on.
    If you have rails console access:
        - Submit an attachment to an assignment in the course with the
          new annotations flag turned off
        - Observe that the preferred_plugin on the associated Canvadoc
          object is 'nil'
          - canvadoc_obj = Canvadoc.last # or whatever
          - # send has to be used cause #preferred_plugin is a private
          - # method.  Returns nil or 'pdfjs'
          - canvadoc_obj.send(:preferred_plugin)
        - Turn the feature flag on for the course (either through the
          course settings or through the account)
        - you should not need to resubmit, and shoudl see that the
          preferred_plugin gets set to 'pdfjs'.  It should toggle from
          pdfjs to nil and back when turning the feature flag on and
          off, whether at the account level or the course level

Change-Id: I6dd70fa2b379d527315dd7e14ee6ff8cceda024e
Reviewed-on: https://gerrit.instructure.com/84956
Tested-by: Jenkins
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2016-07-15 21:15:37 +00:00
James Williams b1f3daf044 rails 4.2: misc spec fixes
refs #CNVS-26056

Change-Id: Ia94ee2fcfded1ec66cb77a19085b005c81304800
Reviewed-on: https://gerrit.instructure.com/70251
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-18 21:45:39 +00:00
Cameron Matheson 85c1a75c8b canvadocs: don't accidentally enable annotations
fixes CNVS-25125

Test plan:
  * enable crocodoc
  * enable canvadocs (*without annotations*)
  * submit homework with a non-crocodocable file type
  * make sure the speedgrader preview does not have annotations enabled

Change-Id: I6feab5fd9bb149e7eddf8c8564d9bba6f409268c
Reviewed-on: https://gerrit.instructure.com/67434
Reviewed-by: Zach Wily <zach@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
Tested-by: Keith T. Garner <kgarner@instructure.com>
2015-11-18 21:40:00 +00:00
Cody Cutrer 912a2cb083 rspec 3-ify spec/models
refs CNVS-16239

Change-Id: I0dc5ac9cb86fbb5dd0335d9e21d77d4a48ecb774
Reviewed-on: https://gerrit.instructure.com/42697
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2014-10-14 20:10:03 +00:00
Cameron Matheson 33b4eb55f9 canvadocs
This commit adds support for document previews from a Box View
compatible API.

closes CNVS-12416

Test plan:
* NOTE: check everywhere for previews (speedgrader, files list,
  individual files page, etc?)
* Enable Scribd and Crocodoc
  * attachments should be previewable in scribd or crocodoc (submission
    attachments should go to Crocodoc)
* Enable Canvadocs
  * Files that previously previewed in scribd should now go to
    Canvadocs.  Nothing should ever go to scribd.
  * New submission attachments should continue to use Crocodoc (for
    supported file types)
  * Other attachments should preview in Canvadocs

Change-Id: I173e4fabc0ae677cdddd4bd065777a90360c1f34
Reviewed-on: https://gerrit.instructure.com/34535
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2014-05-09 22:38:57 +00:00