fix failing calendar feed spec

Change-Id: I3c5d13948a88d4bcc52c1524366eaea235a8bdbf
Reviewed-on: https://gerrit.instructure.com/16693
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
Revert "validate authenticity token on quiz backup and submit"

This reverts commit 5ef87548a82b965ec51525bb81f24f4f955e842f.

people keep quizzes open in tabs for a long time, and since we don't handle
being logged out and back in in another tab well, we need to revert this for
now.

fixes #CNVS-2696

test plan:
- start a quiz in one tab
- in another tab, log out and back in
- submit the quiz in the original tab
- you should not get an authenticity token error

Change-Id: Id1be2425e95d679c78673e94324e411a109d26c7
Reviewed-on: https://gerrit.instructure.com/16677
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
make all teacher permissions configurable

Two discussion-related permissions weren't configurable for
teacher enrollments, now they are.

Test Plan:
 * In the permissions UI make sure "View Discussions" and "Post to discussions" are editable for teacher roles

closes #CNVS-2635

Change-Id: I3d886c33a591fcd4d47058e35dc77a4ab0f3a78e
Reviewed-on: https://gerrit.instructure.com/16597
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
remove unused association

test plan:
 * no behavior change - specs should still pass

Change-Id: I2b53389e2c2715395628b2eda688d913f309e3e5
Reviewed-on: https://gerrit.instructure.com/16689
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fix facebook integration

facebook puts canvas in an iframe - we have to allow it to

test plan:
 * link your facebook account with canvas
 * go to canvas from facebook
 * it should not be blank

Change-Id: I1b5ecfbe121d2e519447daed9af5c86f52ffcc21
Reviewed-on: https://gerrit.instructure.com/16695
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
apply overrides when showing a quiz

fixes #CNVS-510, #CNVS-511

test plan
- start with a course with students in different sections
- create a quiz with a lock date that locks the quiz currently
- create a lock date override that unlocks the quiz for one section
- ensure that a student from a section that the override does not apply to
  sees the original "Availability" dates and cannot take the quiz
- ensure that a student from the section that the override does apply to
  sees the overridden "Availability" dates and can take the quiz
- ensure that an observer observing the overridden section sees the
  overridden "Availability" dates
- ensure that an observer observing the overridden student sees the
  overridden "Availability" dates

Change-Id: Ib07b8ffd93f4077f40e814de607a774ec9626b06
Reviewed-on: https://gerrit.instructure.com/16398
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
fix PopulateStreamItemAssociations data fixup

fixes gh-258

the dropped columns initializer was hiding the data from the migration,
so avoid using the model at all

Change-Id: I25fa901a36c17a30587725b482a74eff62da5094
Reviewed-on: https://gerrit.instructure.com/16658
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
spec: one more conversations transitionary commit

when adding to the user_ids, use the same type of object as the caller

Change-Id: I96ac0cd95c4b3492a398620c562af360a92e1036
Reviewed-on: https://gerrit.instructure.com/16623
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
stop writing to discussion topics in stream items.

fixes #CNVS-2591

while cleaning discussion topic data for stream items, the
original discussion topic was having its root entries
inadvertently deleted. this commit edits a cloned discussion
topic so that the original isn't written to.

test plan:
  * create a discussion topic with the "Users must post
    before seeing replies" option checked;
  * create at least one discussion entry for that topic;
  * create a stream item w/ the created discussion topic as
    its asset;
  * call `data` on the stream item with a viewing_user_id of
    a user in the course that has not posted on the
    discussion;
  * verify that the original discussion topic's root entries
    have not had their discussion_topic_ids set to nil.

Change-Id: I4cddaeaceb13aee5aaeae4209c1567148766c1e6
Reviewed-on: https://gerrit.instructure.com/16683
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
specs: removal of files in parallel_exclude.rb

Change-Id: Ic2796bef0c636973ed369b61c8b07aca39c8c4fc
Reviewed-on: https://gerrit.instructure.com/16593
Reviewed-by: Jake Sorce <jake@instructure.com>
Tested-by: Jake Sorce <jake@instructure.com>
QA-Review: Jake Sorce <jake@instructure.com>
fix cross-sharding bug for primary enrollment courses

refs #CNVS-2634

TEST PLAN:

1) start with 2 students on the same shard
2) add 2 courses, one on the same shard as the
  students, one on a different shard.
3) the target student should be given an
  active enrollment in the remote-shard course
4) the distracting student should be given a
  completed enrollment on the local-shard course
  WITH THE SAME LOCAL ID AS THE ACTIVE ENROLLMENT
  FOR THE TARGET STUDENT
5) run '#courses_with_primary_enrollment' on
 the target student AR object.
6) the remote-shard course should be present
  in the returned courses array.

Change-Id: Icf892839e90ea0c5e7de69802e4979db9e9d2a23
Reviewed-on: https://gerrit.instructure.com/16635
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
bump rails to 2.3.15

Closes #CNVS-2691

test plan: In theory this could affect most anything. However, most of
the differences between 2.3.14 and 2.3.15 were security patches that
we'd already applied manually. See
https://github.com/rails/rails/commit/v2.3.15

Change-Id: I60626ba66a2b257674cb3e412282979558464954
Reviewed-on: https://gerrit.instructure.com/16641
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
extend Account.get_special_account to support possibly not creating the account

Change-Id: I53e2bb58e3b4d01f163918658a968ef711efb0f5
Reviewed-on: https://gerrit.instructure.com/16715
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
show right course domain for new users in course invites.

fixes #CNVS-2581

when sending a course invitation, rely on the course's
HostUrl instead of the user's HostUrl. This ensures that
new users will see the proper domain (e.g. the domain of
the course) instead of "canvas.instructure.com."

test plan:
  * register a new user - a user w/o an account in canvas -
    for a course;
  * view the email sent and verify that it displays the
    domain of the course and not the default domain.

Change-Id: I37f09037100d42f0d9fe52eb2172c6562ff3e976
Reviewed-on: https://gerrit.instructure.com/16512
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
spec: added spec/integration/files_spec.rb back to exclude list

Change-Id: I394f273a0b04e446bad1faf3022472f0e3d7480c
Reviewed-on: https://gerrit.instructure.com/16722
QA-Review: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
this migration is non-transactional

Change-Id: Ia54bd05cc58ee95160b52dd27c918df2bba005eb
Reviewed-on: https://gerrit.instructure.com/16719
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>