be tolerant of slightly different format of PG error messages

test plan:
 * run active_record_base_spec.rb on different postgres installs

Change-Id: I294353a729d19ebfb522446d5fd1c5a121b8a911
Reviewed-on: https://gerrit.instructure.com/14477
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
allow sis term parameters fixes #11070

Change-Id: I1b224f99a437b0dec076921cfa78469b18455224
Reviewed-on: https://gerrit.instructure.com/14397
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
VDD: assignment override data structures

refs #10831

test-plan:
  - run specs. this is all infrastructure, no real separate test plan.

Change-Id: Ic67f574b7e4cbffd114f6ed34d306a393a6bd93c
Reviewed-on: https://gerrit.instructure.com/14117
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
VDD: efficient application of assignment overrides

refs #10831

test-plan:
 - create a course, student, and assignment
 - create an assignment override that applies to the student
 - the return value of assignment.overridden_for(student) should act
   just like assignment, but with the overridden values in place
 - the overridden assignment should not be able to be saved
 - create multiple assignment overrides that apply to the student
   (adhoc, group, sections, etc.)
 - the overrides should be applied in the correct order
 - overrides that don't affect a field should let lower priority
   overrides affect it
 - create an override and then delete it (without changing the
   assignment version in between)
 - the override should not apply
 - create an override, then bump the assignment version, then delete the
   override
 - the override should apply to the old version of the assignment but
   not the new one
 - bump the assignment version, then create an override
 - the override should apply to the new version of the assignment but
   not the old one

Change-Id: Ib632903640cb8aeae5bbc8959c244f6923690f29
Reviewed-on: https://gerrit.instructure.com/14135
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
improve delayed_jobs process management

use process groups to be able to differentiate between running and
draining, and to easily stop workers without draining.

 * added --with-prejudice to stop (or restart) without draining first
 * added --with-extreme-prejudice to kill -9 running jobs
 * don't remove the pid file when stopping, so that you can call stop
   again with one of the above
 * improve status to detect the difference between stopped and
   draining
 * don't start a daemon if one is already running

test plan;
 * ensuring you have some long running jobs that would need to be
   drained, use ps to verify that all of the following work correctly:
   * start with no pool running
   * start with a pool running (doesn't allow it)
   * start with a pool draining (allows it)
   * stop (allows jobs to drain)
   * stop --with-prejudice (doesn't allow jobs to drain)
   * status (differentiates between stopped, running, and draining)
   * stop --with-extreme-prejudice (doesn't allow jobs to drain, and
     even kills jobs stuck in IO)
   * restart (drains currently running jobs, but starts the new pool
     immediately)
   * restart --with-prejudice (stops currently running jobs
     immediately, and starts a new pool immediately)

Change-Id: If7aa05f6a81c1cbd27df95777097834095fb406b
Reviewed-on: https://gerrit.instructure.com/14441
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
fix folder name text box size

fixes #11054

test plan:
  1. login as a teacher
  2. go to a course and click Files in
     the left hand nav
  3. click Add Folder
  4. verify that the name text box does not overflow out
     of the right hand frame

Change-Id: I07e9f87a101091f74a8e23a1d38de9667554f801
Reviewed-on: https://gerrit.instructure.com/14400
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
store and query hashed access tokens

refs #8943

This is phase 1. Once this is rolled out and the migrations have
finished, we can implement phase 2, which is dropping the token field so
that plaintext tokens are no longer stored in the database.

There should no longer be any code that reads the token attribute, it's
kept in the database purely to help with the transition.

test plan: before the postdeploy migration runs, access tokens should
still work. after it runs, access tokens should still work.
newly-created access tokens should work as expected. expired access
tokens should still error. For now, the plain-text token field should
still be populated for new tokens.

Change-Id: Icb1b4fdc8e2627ba6540d96d23eb28d874020acb
Reviewed-on: https://gerrit.instructure.com/14491
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fix api paginatations that were returning a path, not an absolute url

fixes #10693

Also added a test to api_call spec helper to catch these in the future.

test plan: for all available api endpoints that use pagination, the Link
header returned should use absolute urls (http://<canvas>/api/v1/...
rather than just /api/v1/...).

Change-Id: Ia53d32e6902430bd554d322461a36323d5f2d3c3
Reviewed-on: https://gerrit.instructure.com/14502
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
spec: fix sub-second precision bug in assignment_spec

Change-Id: I1c49cc205bae79c62e8fe9067fc704f7f33fd373
Reviewed-on: https://gerrit.instructure.com/14535
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
add missing title element, fixes #11298

test plan:
1. go to /register
2. there should be a page title

Change-Id: I71b234583bf8e84e335b905e164a0d12553b7db5
Reviewed-on: https://gerrit.instructure.com/14483
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
spec: fix access token auto-creation in api spec helper

Change-Id: Idc5275c434123c7d74053e7caf6963cfeffb8ad5
Reviewed-on: https://gerrit.instructure.com/14533
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
reference enrollments table directly in a query fixes #11295

test plan:
 * accept a course invitation from your e-mail while not logged in

Change-Id: I835591091eee33c3d461587341286691fe03ca62
Reviewed-on: https://gerrit.instructure.com/14476
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
api: documentation tweaks

fixes #11316

test plan:
- generate api documentation
- it should not warn about 'api:SubmissionsApiController'

Change-Id: I07ff5ddfd1e5151d0a5733bb79c7eb11b536b98f
Reviewed-on: https://gerrit.instructure.com/14543
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
add default_view to course object api

test plan:
 - fetch a course object through the api
 - ensure that the returned json includes a 'default_view' field that
   corresponds to the course's default view setting

refs #10891

Change-Id: If002fb255adc8edfd4d91de24a5a9e561c9361f0
Reviewed-on: https://gerrit.instructure.com/14447
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
catch all exceptions during LDAP bind

it wasn't catching ENETUNREACH

test plan:
 * set up an LDAP server with an IP address in a private address
   range that you can't reach from your computer and a login id
   attribute set
 * try to log in (probably from another browser, so you can remove
   these settings with your current login session)
 * you should not get a page error

Change-Id: Ibfe1a1dfe5493ed527b114ed5adf33d4f45896a4
Reviewed-on: https://gerrit.instructure.com/14559
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
add Transifex link to course and account setting pages

fixes #11146

course test plan:
  1. login as a teacher
  2. create a course
  3. go to the course settings page
  4. click on 'Edit Course Details'
  5. notice the new link to Transifex right
     next to the language drop down

account test plan:
  1. login as an Admin
  2. go to a managed account
  3. click 'Settings' on the left nav
  4. notice the new link to Transifex right
     next to the language drop down

Change-Id: Ib1d8d4b40c90f50cd442b38ead18fd0073fd63b2
Reviewed-on: https://gerrit.instructure.com/14362
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
fixed css class typo for tab in group model

Change-Id: I4a2cc56e2dc3411f11b99326516a20cb4bd158aa
Reviewed-on: https://gerrit.instructure.com/14556
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
remove /menu_courses route/action

it's not used by the app, causes confusion in the code, and shares
the same cache key as all_menu_courses so would break things if it
were used

test plan:
 * ensure functionality around customizing the courses menu works

Change-Id: I141b66d8368ccfeb3159fdb95df96090e5828656
Reviewed-on: https://gerrit.instructure.com/14532
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
remove support for {schema} substitution in username in database.yml

just use the more generic form %{schema_search_path} if you still
want to use it

test plan:
 * verify database connections still work

Change-Id: Iff149391f1975de1781c2be11f23b8bcf51b4eb4
Reviewed-on: https://gerrit.instructure.com/13872
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
change label on main navigation.

navigation label changed from "main" to "main navigation" to
match the navigation/label example given on
http://www.w3.org/WAI/GL/wiki/Using_aria-label#Example_1

test plan:
  * navigate to any page in canvas;
  * using a screen reader, list page landmarks and verify that
    the main navigation is read as "Main Navigation."

Change-Id: Idb95b31c82a801ae3368135dfbd21dec3158b304
Reviewed-on: https://gerrit.instructure.com/14298
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>