spec: mark context modules spec as pending

Change-Id: I4e98fb8b1a449022554f7076712e2ef46f225fd3
Reviewed-on: https://gerrit.instructure.com/12105
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
remove student view student from collaborations page

fixes #9159

the student view student was showing up as one of the users listed on the
collaborations page, but adding the student view student to a collaboration
resulted in an error. this simply removes the student view student as an option
on the page and disallows the student view student from using collaborations.

test plan:
- in a course with collaborations enabled
- enter student view
- go to the collaboration page, you should receive an unauthorized message
- leave student view
- go to the collaborations page
- the student view student should not be in the list
- select all and create
- the collaboration should work

Change-Id: I574f4f2caa6b0627dcd1a91acd4cb3699be4583a
Reviewed-on: https://gerrit.instructure.com/11927
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
spec: add coverage to scheduler file

also cleaned up and refactored file

Change-Id: Ie9f437f8ba20f7a49052553f367ed8212c414950
tested:
  * allow appointment group time slots
    to be split up
Reviewed-on: https://gerrit.instructure.com/12067
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
clarified the text above the publish course button

fixes #7831

test plan
  - start a new course
  - course name, assignments, students, blah blah, save
  - go to the 'publish course' step of the course setup wizard box
  - it should no longer say that an email is sent out when the course is
    published

Change-Id: I4e81a88ab111b605da8e542ec711d8a227147777
Reviewed-on: https://gerrit.instructure.com/12099
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
show only linked observers to students in messageable_users

fixes #8673

test plan:
 - set up a course with students and observers
 - link an observer to a student
 - as a student, go to Inbox and click the address book icon
 - verify that the only Observers that show up are those that
   are linked to you

Change-Id: I2d9dfac1717c43b4327b48ef43efcffba34b30b1
Reviewed-on: https://gerrit.instructure.com/11971
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
use singletons in periodic job scheduling

This simplifies the periodic jobs implementation quite a bit, and makes
it easier for other job backends to implement periodic jobs if they
can't trivially search existing jobs like the AR implementation can.

To make this work for all 3 supported DBs i modified the AR singleton
code to do a select + maybe insert in MySQL and SQLite3, rather than the
delete_all + insert like they were doing before.

The implementation on MySQL requires locking the whole table, and on
SQLite3 requires locking the whole database, but that's already true of
db inserts in general on those two systems.

Postgres was already doing the select method.

test plan: run two delayed jobs pools, and watch that the periodic jobs
auditor runs properly as before, without inserting duplicate jobs or
causing issues with jobs not running.

Change-Id: I98f52e3ebd75f3370a9957d0596befa4233cb53f
Reviewed-on: https://gerrit.instructure.com/11944
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
account-level user quota defaults, closes #9198

adds (root) account-level setting for (default) user file quotas. defaults
to 50 MB.

test plan:
1. on a root account, change the default user quota to something other
   than 50 MB (e.g. 1 MB)
2. as a user in that account:
   1. go to /users/self/files/quota . you should see the new quota
   2. attempt to upload files. once you have hit/exceeded the quota, you
      should not be able to upload additional files
3. as a user in multiple (root) accounts:
   1. go to /users/self/files/quota . your quota should be the sum of the
      root account user quotas
   2. attempt to upload files. once you have hit/exceeded the quota, you
      should not be able to upload additional files

note that the previous behavior does not change in that one file can exceed
your quota. e.g. if your quota is 1 MB, you can upload a 2 MB file. only
then will you be prevented from uploading additional files

Change-Id: If7f5903fb54eb2b62d80a2b4ee8adfcc48a63683
Reviewed-on: https://gerrit.instructure.com/12005
Reviewed-by: Joe Tanner <joe@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
spec: add more coverage to collaborations file

also refactored the file to follow QA conventions

Change-Id: Ieeece944ac7d121f4c2dcc20fb285971582bf30a
tested:
  * edit collaborations
  * delete collaborations
Reviewed-on: https://gerrit.instructure.com/12055
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
spec: add more coverage to calendar file

also clean up and refactor the file

Change-Id: I57f8b68b91f5b8476764b955e8ee6f7b8f3ff171
tested:
  * create an event
  * view the full details of the event
  * drag and drop an event
  * delete an event
  * view undated events
  * validate ical feed
  * navigate mini calendar
  * mini cal <-> main cal
Reviewed-on: https://gerrit.instructure.com/12104
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
spec: add coverage to calendar2 file

also refactored and cleaned up the file

Change-Id: I68f0480817398a5e4a13ad345f31c330402db873
tested:
  * drag and drop event
Reviewed-on: https://gerrit.instructure.com/12065
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
partially revert "add foreign keys part 1"

This partially reverts commit a51d1ac78b682d22d2f0567c4f2e2f00c441abfa.

The changes to config/initializers/active_record.rb were not reverted

Conflicts:

	config/initializers/active_record.rb

Change-Id: Iaab8c5bacd90381543ebad6a01916c553339ac04
Reviewed-on: https://gerrit.instructure.com/12113
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
only set focus on link if using keyboard nav, fixes: #9211

Change-Id: Id1bbde5d933ad0d7d6e994f4ed89681d59823b56
Reviewed-on: https://gerrit.instructure.com/11932
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
be more specific about fixing group_category_ids

it looks liek all of the "bad" data is 0, presumably from an
incorrect html form

also do the migration transactionally, to avoid the race condition
(the tables are small enough that a two-step FK addition isn't
necessary)

test plan:
 * run the migration; ensure it takes less than 1s, and doesn't
   fail

Change-Id: Ibe8ff590c41f3d07d51814564fefa8b986a78535
Reviewed-on: https://gerrit.instructure.com/12116
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
don't omit the drag target from the order list, fixes #8689

test plan:
 * find or create a course with multiple assignment groups
 * try to drag an assignment group to somewhere other than
   the top slot
 * it should stay where you put it, and not snap to the
   top slot

Change-Id: I966144fd8ef92ef9357a75b5abd64ffb90211366
Reviewed-on: https://gerrit.instructure.com/12092
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
update the redis gem to 3.0.1

This required building our own fork of the redis-store gem so that we
could update its dependency, and fix one small issue with redis connect
strings getting nil instead of the default value for the port number.

The redis 3.0.x gem now catches all Errno and Timeout errors and
re-raises them as subclasses of Redis::BaseConnectionError. It also now
handles EAGAIN internally, retrying when appropriate. So we've modified
our redis failure handling code to match.

test plan: verify the redis failure handling code still works (specs
pass). for instance, stop redis locally and see that canvas works in the
degraded state. make sure that redis still works for both caching and
non-caching code such as login attempts.

Change-Id: I9e8d3929afa06c522656d30f71efc0427e4ef7cc
Reviewed-on: https://gerrit.instructure.com/11521
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
spec: add spec to syllabus file

tested:
  * validate jump to today link

Change-Id: I517748fc2f84d8ab39f9484b5d2d4f4de4322a8d
Reviewed-on: https://gerrit.instructure.com/12001
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
add api to get section info fixes #5885

Move CoursesController#sections to SectionsController#index, api-ify
SectionsController#show, refactor out sections_json, and bring docs
up to newer standards (@returns)

test plan:
 * ensure /api/v1/courses/:id/sections still lists sections, and
   includes of students works as well
 * /api/v1/courses/:id/sections/:id should return some basic
   section info
 * test that you can't find a section for the wrong course
 * test /api/v1/sections/:id works for raw ids and section ids

Change-Id: Ie6bf2257e0138ff7a76a5670a6cc041fcce0cd54
Reviewed-on: https://gerrit.instructure.com/12117
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
spec: split up context modules

also refactored selenium/helper files to include
the selenium common file so any file using a common
file only has to include one file

Change-Id: I133f757da0e15a2f5e31999b45f137567f679ed7
Reviewed-on: https://gerrit.instructure.com/11986
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
use safefiles for object/embed tags in api responses, closes #8115

This modifies the API to return information on the required user_content
params for api responses. The javascript then processes the api response
fields and replaces the user content with iframe posts to safefiles,
same as we do server-side in erb currently for user_content in non-api
responses. This is done before the html is inserted on the page.

The current implementation requires the api to respond with these extra
data attributes all the time, not just for in-app requests. This isn't
ideal, but other api users will safely ignore those extra data
attributes.

test plan: in a discussion, post a reply that contains an object or
embed tag. reload the page and verify that the flash or java or whatever
still appears. inspect the html, and check that it is contained inside
an iframe pointing to the safefiles domain, rather than embedded
directly on the main canvas domain.

Change-Id: I5f1c5f4f267f654ec339ee422f0743f33ee2564f
Reviewed-on: https://gerrit.instructure.com/12111
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
makes inline equations vertically aligned to the middle

fixes #8904

test plan:
* enter a formula into any rich content editor (like an assignment
  description or something)
* make sure it is vertically aligned to the center with normal text
  before and after saving

Change-Id: I056e6ca9fc24c3114777cd7bf654ca59c0270a57
Reviewed-on: https://gerrit.instructure.com/11875
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>