Commit Graph

8 Commits

Author SHA1 Message Date
Stanley Stuart 5731885965 use spec_helper instead of just ams_spec_helper
Using just ams_spec_helper seems to cause issues on
CI due to dependening on some libraries that have been
extracted from Canvas.

Change-Id: If64c7281b1e9cf0ca18c6c671f180e2010fa4bf7
Reviewed-on: https://gerrit.instructure.com/29460
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-01-30 07:04:14 +00:00
Joshua Simpson 1e81ea7caa move quiz into quizzes namespace as a precursor to enginifying
fixes CNVS-10679
this commit refactors quiz into a quizzes namespace. it contains various
shims to facilitate the data migration of polymorphic relationships
('Quiz' -> 'Quizzes::Quiz').  JIRA contains several tickets linked to
the above tickets in regards to removing these shims after the data
migration, as well as the strategies on reverting the shims once the
data migration is complete.
Change-Id: I30c566d60a87af6ee83e9d0041fdcb909ead6a89
Reviewed-on: https://gerrit.instructure.com/28573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-01-24 00:08:46 +00:00
Stanley Stuart e340d1a762 Revert "create PermissionsSerializer for serializing permissions"
This reverts commit cf8716bfb0.

Change-Id: I7c58b7533d2d34c4ddb3fd4d3f491b1656f71d84
Reviewed-on: https://gerrit.instructure.com/29135
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
2014-01-23 05:17:23 +00:00
Stanley Stuart cf8716bfb0 create PermissionsSerializer for serializing permissions
test plan:
  - specs pass
  - You should see a "permissions" object in the quizzes API,
    both when using the JSONAPI version and normal version.
  - In the JSONAPI version, in the "meta" object, there should be
    a "permissions" object with a "create" key. It should be
    "create": true for teachers/admins and "create": false for
    students.

Change-Id: I74f89b41605b369ddb4c2b09e5d5752ce22d5edb
Reviewed-on: https://gerrit.instructure.com/28831
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2014-01-22 17:48:39 +00:00
Stanley Stuart cd00879045 improve relationship support for Canvas::APISerializer
Adds better support for relationships with regards to
ActiveModel::Serializers through Canvas::APISerializer:

- Serializing a url is now the default if your relationship is
`embed: :ids` (implied embed_in_root: false)
- Serializing IDs is the default if your relationship is
`embed: :ids, embed_in_root: true` (relationship is sideloaded with
the main response)
- Stringifying ids is now the default. You can opt out by defining
a `stringify_ids?` method on your serializer.
- Introduce Canvas::APIArraySerializer for our own needs since
ActiveModel::ArraySerializer calls `serializable_object` instead
of `as_json`, bypassing stringification.

Also fixes an issue where subclassing Canvas::APISerializer
would not get stringified if you overrode `serializable_object`.

test plan:
  - make sure the jsonapi version of the quizzes api still works.

Change-Id: I301648d3e21b887eb7c2502cc00dec023fbbf79d
Reviewed-on: https://gerrit.instructure.com/28116
QA-Review: Myller de Araujo <myller@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2014-01-20 19:37:58 +00:00
Jason Madsen d7aa916433 tooltips for ember quiz index varied due dates
closes CNVS-9401, CNVS-10098

test plan:
  - enable fabulous quizzes
  - create a quiz with multiple due/availability dates
  - navigate to quiz index
  - verify that tooltip displays as it does with non-ember quizzes
    -- as described in g/26792/
  - verify that quizzes are sorted by dates:
    - due date
    - then, multiple dates
    - then, no dates

Change-Id: I8d772d0ab2416832300ff60784b192842fc54bcb
Reviewed-on: https://gerrit.instructure.com/27243
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2013-12-31 19:41:36 +00:00
James Williams 8abfd08e94 undefine Foo after using in canvas_api_serializer_spec
Change-Id: I90a1183d5d065d6493bfed0bcbdb77c9799e3f68
Reviewed-on: https://gerrit.instructure.com/27937
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2013-12-30 13:16:37 +00:00
Stanley Stuart 5f2089c889 import ActiveModel::Serializers port and convert quizzes api to it
test plan:
  - The quiz api should work like it normally does when you don't pass
    an 'Accept: application/vnd.api+json' header.
  - The quizzes index page and quiz edit page should work like they
    always do.
  - Testing the Quizzes API for "jsonapi" style:
    - For all requests, you MUST have the "Accept" header set to
      "application/vnd.api+json"
    - Test all the endpoints (PUT, POST, GET, INDEX, DELETE) like you
      normally would, except you'll need to format the data according to
      the next few steps:
      - For "POST" and "PUT" (create and update) requests, you should send
        the data like: { "quizzes": [ { id: 1, title: "blah" } ]
      - For all requests (except DELETE), you should get back a response
        that looks like: { "quizzes": [ { quiz you requested } ]
    - For the "delete" action, you should get a "no content" response
      and the request should be successful

Change-Id: Ie91deaeb6772cbe52a0fc46a28ab93a4e3036061
Reviewed-on: https://gerrit.instructure.com/25997
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-12-26 20:32:39 +00:00