spec: various non-selenium draft-state spec fixes

Change-Id: I936864c61f54a2b06209c53417d3c5935c895da7
Reviewed-on: https://gerrit.instructure.com/43267
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
lti2 course and account nav placements

fixes PLAT-658 PLAT-660 PLAT-661

test plan:
setup:
fixes PLAT-658 PLAT-660 PLAT-661

test plan:
*setup:
register an lti tool using the following url template
/accounts/#{account_id}/lti/tool_proxy_registration?
tool_consumer_url=http://lti-tool-provider-example.herokuapp.com/tool_proxy

ignore the canvaception during the registration

*testing:
there should be course and account nav placements for the tool

Change-Id: Ie02fffdc3a1ede70216db2b21d9f4bd17f53f36d
Reviewed-on: https://gerrit.instructure.com/42094
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
fix missing lock info for external module items

test plan:
 1. create a module that requires sequential progress
 2. add an item with a completion requirement
 3. add an external URL and external tool after this item
 4. as a student that has not fulfilled the requirement from
    step 2, use the module items API with include[]=content_details
    to list the module items from step 3.
    - use both /api/v1/courses/X/modules/Y/items and
               /api/v1/courses/X/modules/Y/items/Z
    - these should include lock information for the external URL
      and external tool

fixes CNVS-14190

Change-Id: I5064062b46dfbd1d51b1b1622bf21cc10169face
Reviewed-on: https://gerrit.instructure.com/42622
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
re-allow POST for saml_consume

fixes CNVS-16409

Change-Id: I4b4d732d4cc4be0a171b53fe4327694b96177edb
Reviewed-on: https://gerrit.instructure.com/43276
Reviewed-by: Paul Hinze <paulh@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
make course settings form more accessible

change the course settings form so it's
always a form (similar to the account settings form)
so that way the labels always have referenced elements

test plan:
* using a screenreader, the labels should always reference
the proper input items (rather than labelling nothing
until the "edit" button is clicked)

closes #CNVS-16234

Change-Id: I66d64c5000c6e43291c34536452518ba1dee0945
Reviewed-on: https://gerrit.instructure.com/43091
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
after_transaction_commit gem extraction

refs CNVS-15881

our delayed_job depends on this, so I'm pulling it out into a gem first,
so that we can fully gemify our fork of delayed_job and use it in other
apps.

I modified the code to be built on top of the after_commit callback
functionality added in rails3, and I pulled in the test_after_commit gem
(after making a fix to it), which emulates transaction callbacks in test
mode. This makes it easier to write tests that interacts with these
callbacks, and cleans up some code in the app that was checking for test
mode and changing behavior. Fortunately, it behaves well with once-ler.

Side note: now that we are on rails3, we could replace some, but not
all, of our usage of after_transaction_commit with after_commit AR
callbacks. I didn't do that in this commit, to minimize churn.

test plan: things that happen in commit callbacks should still happen as
expected. for instance, with caching enabled, changing a /plugins
setting should still take effect immediately, because the cache is
cleared in a commit callback.

Change-Id: I66af5f66bf9fa9354352ed37edec8bd92d8e39c8
Reviewed-on: https://gerrit.instructure.com/41819
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
extract delayed_job plugin into separate gem

closes CNVS-15881

This mostly involved adding hooks to the gem for things that we were
directly modifying in Canvas, then hooking into those points in the
canvas config/initializers/delayed_job.rb file.

Periodic jobs scheduling changed a bit as well -- there's no longer
support in the extracted gem for reading a special file under config/,
so I moved our periodic_jobs.rb file to a normal initializer.

test plan: delayed jobs should still work as before, including queuing
jobs, running the worker pool, and in tests.

Change-Id: I9ce57091d18f21f4355011fcb75230193d53facb
Reviewed-on: https://gerrit.instructure.com/42027
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
fix download cog item in new files

test plan:
 - enable "better file browsing"
 - confirm that the "download" item at the top of the cog menu
   for files and folders is operational

fixes CNVS-16287

Change-Id: Iac3e394bcbdfec8a7905d435f7c4f9b0e5787402
Reviewed-on: https://gerrit.instructure.com/43216
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Makes new file preview film strip links work

fixes CNVS-16240

Test Plan
  - Enable New Files
  - Preview a folder with multiple files
  - Open up the footer
  - Click on another item in the footer
  - The preview should change to that file.

Change-Id: I144b00a01fb8dfee625a66b49b71a71a03677c8e
Reviewed-on: https://gerrit.instructure.com/43273
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Dan Minkevitch <dan@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
add foreign keys to grading_periods table

closes CNVS-16414

Change-Id: I58543fbc267350871b170b5a58644d54b9721c09
Reviewed-on: https://gerrit.instructure.com/43211
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
publish_grades refactor

fixes SIS-600
partially reverses g/32659

test plan:
- for a course with and integration id and post grades feature enabled
  post grades button in gradebook should open dialog
- remove due dates for assignments in course
- confirm you're able to add dates in post grades dialog

Notes:
- regression test

Change-Id: I7c7b2109ef083750289290fbb161e47b47bfc4b9
Reviewed-on: https://gerrit.instructure.com/43293
Reviewed-by: Ken Romney <kromney@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>