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>
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>
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>
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>
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>
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>
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>