ember testing

after running `generate app foo` you'll also get
a basic test for your new ember app.

you can run the tests for as specific app with:

  rake js:dev <app>
  rake js:dev quizzes

Change-Id: I55c53e875c06d44ae553100bf8d73a4ee83ba278
Reviewed-on: https://gerrit.instructure.com/26023
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
cleanup per_page values for json pagination

if the response is json and paginated, make sure it honors the per_page
parameter. also, make sure we don't accidentally allow arbitrarily large
per_page values.

test-plan:
  [check this per endpoint]
  - have more than <max> entries (e.g. apps in the app center)
  - fetch <endpoint>
    - should get a page with <default> results
    - link with rel="next" should embed per_page=<default>
  - fetch <endpoint>?per_page=<max+1>
    - should get a page with <max> results
    - Link header should have a link with rel="next". that link should
      embed per_page=<max>
  - fetch <endpoint>?per_page=1
    - should get a page with 1 result
    - link with rel="next" should embed per_page=1

  [endpoints]
  /api/v1/courses/:course_id/app_center/apps
    default: 72
    max: 72

  /api/v1/courses/:course_id/app_center/apps/:app_id/reviews
    default: 15
    max: 50

  /conversations/discussion_replies.json
    default: 15
    max: 50

  /courses/:course_id/users/:user_id/usage.json
    default: 50
    max: 50

  /courses/:course_id/group_unassigned_members.json
    default: 15
    max: 100

  /courses/:course_id/outcomes/:outcome_id/results
    default: 10
    max: 50

  /courses/:course_id/question_banks/:question_bank_id/questions
    default: 50
    max: 50

  /courses/:course_id/quizzes/:quiz_id/moderate.json
    default: 50
    max: 50

  /api/v1/courses/:course_id/activity_stream
    default: 21
    max: 50

Change-Id: Iacb0b413de1175fb70d9b073fccef3e70082e60e
Reviewed-on: https://gerrit.instructure.com/26095
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
create fabulous quiz entry point

closes CNVS-9394

test plan:
  - visit quiz index
  - verify current quiz system displayed
  - enable fabulous quizzes
  - visit quiz index
  - verify ember / fabulous quizzes skeleton displays

Change-Id: Ie0737328b9aaa7bb2f97dc78647107b4ff9a7be2
Reviewed-on: https://gerrit.instructure.com/26204
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
Updated es translation
Updated de translation
update slickgrid to use instructure fork

updated slickgrid to use our fork with frozen columns

added a formatter for student names since the default formatter now
does a naive HTML escape

fixed an error on the jobs page relating to not having a selectModel in
slickgrid

changed some selenium specs to be in line with the new dom structure of
slickgrid

closes CNVS-7909

test plan:
- make sure no functionality in the new gradebook is broken
- make sure the jobs page still functions as expected

Change-Id: Ieaf1230d03b9e455ca26b800adf046e23ecf5457
Reviewed-on: https://gerrit.instructure.com/25847
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Matthew Irish <mirish@instructure.com>
Tested-by: Matthew Irish <mirish@instructure.com>
don't allow 'logging in' as pre_registered users

refs gh-323

a pre_registered user may have been added as an admin or otherwise
logged in

test plan:
 * log in as an admin, go to users list for an account
 * create a new user
 * go to settings for the account, and add that user as an admin
   (it should say "existing user")
 * enable self registration on the account
 * log out, and click the link to register for an account
 * register as a teacher, using the e-mail address you used to
   create the user
 * it should say e-mail address already taken

Change-Id: I8187b86b83588ba70d3c1b6a31a96678fc70a910
Reviewed-on: https://gerrit.instructure.com/26223
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
only log in on user create when the user isn't logged in

fixes gh-323

test plan:
 * go to user pages for a root account
 * add a new user
 * add a second user with the same e-mail address
 * refresh the page
 * it should not give you an unauthorized error

Change-Id: I63e370417d27fe1aea7f2ad4265aaf6f41adfa78
Reviewed-on: https://gerrit.instructure.com/26218
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
add screenreader text to grade by question popover

fixes CNVS-9090

test plan:
- on a grade by question quiz in speedgrader
- try to access the ? icon next to the fudge points box with a screenreader
- it should read the help text

Change-Id: I611ca0b8d31eae8e4d6d60b88c6beb5ac2e42bdf
Reviewed-on: https://gerrit.instructure.com/26217
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fix order of parts in outgoing multi-part emails

the order of the parts in a multi-part email matters. The last
displayable format is the format email clients will display by
default.

fixes CNVS-9184

test plan:
 - configure canvas to actually send outgoing email.
 - configure a user with a real email address that you can
   access. set notifications for this user to asap.
 - have a different user initiate a conversation with the user
   that has the real email address.
 - check for the notification email from the conversation and
   make sure html format is displayed by default.

Change-Id: I4263bb914ad25d305a0578dc7401d795b2664f80
Reviewed-on: https://gerrit.instructure.com/26215
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
calendar2: remove delete button if assignment is frozen

fixes CNVS-9344

test plan:
 - enable the assignment freezer plugin, check all the boxes
 - create an assignment with "lock assignment properties when
   copied" checked
 - copy the assignment to a new course
 - as a teacher in the new course, check that the assignment is
   frozen (can't delete it from the assignments page).
 - as a teacher in the new course, find the frozen assignment
   in calendar 2. click on the assignment and check that the
   delete button is missing from the popover.
 - check that the delete button is present on normal
   assignments.

Change-Id: I3107d67e4e7d811b5e8bd04c90a08596531f1b7c
Reviewed-on: https://gerrit.instructure.com/26246
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
add latest indicator to page revisions

test plan:
 * create multiple revisions (3+) for a wiki page
 * query the revisions using the pages revisions api
   - the most recent revision should have a latest indicator of true
   - all other revisions should have a latest indicator of false

refs CNVS-8486

Change-Id: Id63e7552eb2ae8352be7f8e3ea96dcc21f55fdff
Reviewed-on: https://gerrit.instructure.com/25921
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
GradeCalculator: work with string ids

fixes CNVS-9486

Test plan:
  * set up an assignment group with never drop rules
  * make grades for the assignment such that the assignment that
    shouldn't be dropped would be dropped if it weren't never_drop
  * make sure that the assignment is not dropped

Change-Id: Ia7c772f23c6f01c7fd060bbdcb4efe3eaea386ee
Reviewed-on: https://gerrit.instructure.com/26266
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
fix and improve submissions for students API

fixes CNVS-9321, CNVS-9322

test plan:
 * regression test current behavior for
   /api/v1/courses/X/students/submissions
 * as a student, teacher, and observer (and combinations of the two)
   check submissions?student_ids[]=all. Ensure the expected data is
   returned
 * BEHAVIOR CHANGE: if you pass an id for student_ids[]= that cannot
   be returned (not enrolled, or you don't have access to), it should
   401 in all cases, instead of sometimes 401 and sometimes returning
   no results
 * BEHAVIOR CHANGE: if you pass more (valid) ids than api_max_per_page
   (defaults to 50, you can change it lower for testing purposes), it
   should return a 400 with explanation, rather than silently not
   returning submissions for users later in the list than the max

Change-Id: I5c9a4a84101f3787770d0d425df1deab37e32e6a
Reviewed-on: https://gerrit.instructure.com/26051
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
ensure migration sub options are read when importing content with VO

While in VO and doing a content migration, voice over should read the
content type options as you select them. If you select a content type
option quickly (before voice over can finish reading the label) it
should STILL read the options for the content type you select.

fixes CNVS-7458

Test Plan
1. Go to the content_migrations page in a course ie:
http://localhost:3000/courses/62/content_migrations
2. Make sure you're in Safari using voice over. Navigate to the
"Content Type" dropdown menu.
3. Using voice over, select an option. It should then read the new
options that appear under the dropdown.
4. Using voice over, select an option, however before voice over
finishes reading the label, press enter to select that content type
option. Voice over should STILL read the options under content type as
if you waited for it to finish reading.

Change-Id: I19c79c9427e3d4b39f41c5f3b2d5e0d53e2a1a7e
Reviewed-on: https://gerrit.instructure.com/26251
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>