Commit Graph

300 Commits

Author SHA1 Message Date
Nick Cloward b995981ccc permissions are not caching correctly due to returns
fixes: CNVS-11197

Cleans and simplifies the code to remove the returns and nexts.
The block was short cuirciting the cache methods withe the returns.
Since the caching for permissions is more aggressive a few places in
specs need to clear the cache.

Test Plan:

- Clear cache
- Open a course page
- Check cache to make sure there are permission keys stored for that
  course.

Change-Id: Ib7f747242bfb4394a73876377f4b6ba632f8b728
Reviewed-on: https://gerrit.instructure.com/37100
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-07-02 19:34:22 +00:00
Cody Cutrer c3b0df2474 restrict admins from creating or deleting more powerful admins
fixes CNVS-13351

test plan:
 * created an admin role that has permission to create other admins,
   but that's it
 * as an admin in that role, it should only show that role as one
   to choose for new admins
 * you should only be able to delete admins in that role
 * verify both of the above are enforced via the API

Change-Id: I11459567ab184d787ee02af55280e0f4f76d47e8
Reviewed-on: https://gerrit.instructure.com/35672
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-06-30 20:58:26 +00:00
James Williams 794b61783c fix page view controller and action logging in rails 3
test plan:
* enable page views in rails 3
* using the api, retrieve the page views for a user
* the 'controller' and 'action' fields should not be null

fixes #CNVS-13769

Change-Id: I19748f0f4bb455c8932283adf2a04b2f7d445554
Reviewed-on: https://gerrit.instructure.com/36886
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-06-26 16:47:42 +00:00
Brian Palmer 28a8a4030d enable CSRF protection for logout
No longer allow GET requests to /logout

There were a few places in the app that were doing GET requests to
/logout, as well as some tests, so I fixed those to do a proper DELETE
request.

test plan:

  * Make sure you can log out through the web ui
  * Make sure that the cancel/logout buttons still work properly on:
    * The accept terms of use page
    * The self-registration page
    * The "already enrolled" page that you see when you click an
      enrollment invite for one user while logged in as another user
  * Make sure that SAML and CAS log outs work as well

fixes CNVS-12163

Change-Id: I6a0a520745a21b349d36b004bceccbb0ff2c8503
Reviewed-on: https://gerrit.instructure.com/32723
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-06-16 16:11:09 +00:00
Ethan Vizitei 3c19c96287 apply dual timezone filters
closes: CNVS-9814

add support throughout our formatting layer
to give us a way to convert values
to the wall clock time of the timezone for
a course (or really any other way we choose),
and then apply that to several selected
date/time displays.

TEST PLAN:

- Login as a user who's part of a course
with at least some data in each tab
- Check the following areas to ensure that
the correct timezone-differentiated hover
text is showing up:
  * Announcements -> Date Sent column
  * Announcement Detail -> Date Sent (top right)
  * Assignments -> Due Date column
  * Assignment Detail -> Due Date (bottom table)
  * Collaborations -> Start Date
  * Discussions -> Last Post Date
  * Discussions -> Due Date
  * Discussion Detail -> Post date of each reply
  * Modules -> (if locked) shows date to unlock
  * Quizzes -> Due Date
  * Syllabus -> Dates on the left
  * Syllabus -> Due dates on the right
  * Settings -> Course Details -> start/end date
  * Settings -> Sections -> start/end date
  * Recent activity page -> Everything

Change-Id: I048c2de85d9f9b196d35c6c65ae104dab7441eee
Reviewed-on: https://gerrit.instructure.com/34861
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Drew Bowman <dbowman@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2014-05-23 19:01:34 +00:00
Rob Orton 296af05c8b add a service parameter to our CAS logout
fixes CNVS-12161

test plan
 - regression test CAS login and logout
 - logout should now include service parameter

Change-Id: Ieab7d53021eaf8697bf1636a438a6da4556df905
Reviewed-on: https://gerrit.instructure.com/33498
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-05-21 21:02:50 +00:00
Cody Cutrer 8178266194 split yaml file loading out of Setting
refs CNVS-13024

Setting wasn't properly being initialized as unsharded because
it was loading before Switchman. The reason we need Setting before
switchman is just for yaml loading, so split that into its own
class.

Change-Id: I5456e103cb216dba2d5af4e9c20a697b468c923b
Reviewed-on: https://gerrit.instructure.com/35043
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-05-21 18:27:06 +00:00
Liz Abinante e04a49235e AssignmentOverrides refactor
fixes CNVS-10793
fixes CNVS-12360

test plan
=========
- assignment overrides should still work
- general regression of assignment#new, #edit, quizzes#new, #edit, discussions#new, #edit
- check API end points for above overrides

Change-Id: I211ad888ac14d7e863ab67bfcb27d56a85e62aac
Reviewed-on: https://gerrit.instructure.com/29980
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
2014-05-16 21:12:45 +00:00
Joel Hough d824ea6665 force calendar2_only account setting to true
fixes CNVS-12331

before you check out
- configure some accounts to not use calendar2
- configure some users to prefer calendar1

test plan
- ensure that everyone gets calendar2, all the time, even if they
 specifically checked a box saying they don't want to use it

Change-Id: Ibe1eb6b86ccc1c9489b166c138c87a288eb91ac1
Reviewed-on: https://gerrit.instructure.com/34339
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-05-09 16:33:08 +00:00
Jeremy Stanley 9aca437f5b include module_item_id parameter in draft state page redirect
fixes CNVS-12695

test plan:
 - enable draft state
 - add a wiki page to multiple modules
 - click a wiki page link on the modules page
 - the navigation footer should be present on the wiki page

Change-Id: I1e8c1540f40c97e77a289d1dab263dcd748c4475
Reviewed-on: https://gerrit.instructure.com/34300
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-05-06 23:45:24 +00:00
Raphael Weiner a13f85e0ed move twitter to gem
fixes: CNVS-12492

test-plan:
* Test that all things Twitter related still work

Change-Id: Ib656c5bfcb2dc8490a6fa6f214b0f6dce25ad181
Reviewed-on: https://gerrit.instructure.com/33193
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:27 +00:00
Nathan Mills 8eeb4f5bf0 refactor twitter to not be a mixin
fixes: CNVS-12118

test-plan:
*twitter integration should work

Change-Id: I44a9011eb451aaa8eb196264bb4b65d1635da083
Reviewed-on: https://gerrit.instructure.com/33065
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:17 +00:00
Mark Severson c0480a4dc5 rework module progressions evaluation
test plan:
 * regress module progression workflow for students
   - student progress should always be up-to-date

fixes CNVS-11818

Change-Id: Ib6b4ccf7b93bc490726fe2bf75333d75f1572ee0
Reviewed-on: https://gerrit.instructure.com/31575
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-05-01 16:42:07 +00:00
Raphael Weiner 8be0ae37d7 Move google_docs code into a gem
fixes: CNVS-12329

Change-Id: I044725c93582cbca39a61e036bb5f0385e069c1e
Reviewed-on: https://gerrit.instructure.com/32990
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:43 +00:00
Raphael Weiner c8d7b9f915 Further decoupling of google_docs from models and controllers.
fixes: CNVS-12328

test plan:
  - as admin enable the google_doc plugin
  - as student visit `/profile/settings`
  - click 'Google Docs' under the 'Other Services' section
  - click 'Authorize Google Doc Access' in modal
  - when redirect to google, click 'Allow access'
  - verify success banner displays

Change-Id: I2b45ffa38ac0d1d810fb988335f4cd39154ae2a6
Reviewed-on: https://gerrit.instructure.com/32949
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:34 +00:00
Joseph Rodriguez e0a5065086 replace usages of Quiz#find_or_create_submission with SubmissionManager#find_or_create_submission
fixes: CNVS-12598

  test plan:
    - create a quiz as an instructor
    - as a student
    - take quiz
    - exercise all paths by which a quiz submission is generated
    - verify that quiz submissions continue to work as before

Change-Id: I9fd71679e6c9a45686861609ff481f5f4250cca1
Reviewed-on: https://gerrit.instructure.com/33735
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-24 19:33:08 +00:00
Raphael Weiner 732d4991e5 extract linkedin into a gem and add tests
fixes: CNVS-12119

test plan:
regression test linkedin functionality

Change-Id: I9cec121d641db37d4c8f6a04966e766e9f8b293e
Reviewed-on: https://gerrit.instructure.com/33473
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 20:23:55 +00:00
Raphael Weiner a79605a2ce remove Canvas specific code from LinkedIn
fixes: CNVS-12505

test plan:
regression test linked in functionality

Change-Id: I7d4c327eefb8ac976c1d51e36aa6514c1742f739
Reviewed-on: https://gerrit.instructure.com/33458
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 20:21:47 +00:00
Joseph Rodriguez 32f45d6956 remove #grade_submission from QuizSubmission
fixes: CNVS-12565

test plan:
- as a student take a quiz
- verify that:
  - background submissions are working
  - end of time / date submissions are working
  - manual submsissons are working
- verify various question types are graded correctly
- verify outcomes work as previously defined

Change-Id: Ia85141559e8026993c0e270267947128a5a0466b
Reviewed-on: https://gerrit.instructure.com/33669
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 19:28:03 +00:00
Raphael Weiner 19926a2120 Change LinkedIn to be standalone class not mixin.
fixes: CNVS-12498

Test Plan:
* regression test linkedin functionality

Change-Id: I7ba55dea595d6380e68d5a90b272d67807cb55cf
Reviewed-on: https://gerrit.instructure.com/33441
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 17:30:27 +00:00
Brian Palmer d275fcf0d7 Revert "work around more ipad speedgrader json calls"
This reverts commit f1e3e09b3f.

refs CNVS-12163

test plan: With this commit, make sure that the ipad speed grader app is
able to log in and post comments on submissions.

Change-Id: I0eec14d17c4f4d65b1a33832c1689523caa04c51
Reviewed-on: https://gerrit.instructure.com/32722
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-04-16 15:13:28 +00:00
Raphael Weiner 101cd37bb6 Cleanup google_docs
Change-Id: Iaa8545a3f39cd8708b1ea20a9c27836dcbdacb0a
Reviewed-on: https://gerrit.instructure.com/32860
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 17:32:01 +00:00
Raphael Weiner 7054118441 Refactor google docs to be standalone not mixin.
fixes: CNVS-12096

Change-Id: I6fa7d6d57bfc9063b49334a8e528aaaa9fc7f8c2
Reviewed-on: https://gerrit.instructure.com/32715
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 17:31:39 +00:00
Brad Humphrey ce66769b69 implement lti outbound adapter
also, refactor lti outbound adapter parameters and
convert integration tests to use lit outbound adapter

test plan
 - Ensure that LTI launch parameters are the same before and after this change.
 - Test all of the different kinds of launches for differences

Change-Id: I749e7f7b887eaac87dd104f195b526b18040a2b9
Reviewed-on: https://gerrit.instructure.com/30087
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-03-26 16:49:22 +00:00
Nick Cloward 0216ac2018 extract canvas statsd gem
fixes: CNVS-11605

Change-Id: I44d708d77014d6c4d0f8d0b2f7bcedcdeb307829
Reviewed-on: https://gerrit.instructure.com/31261
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-03-14 15:03:23 +00:00
Jeremy Stanley 470bd3a04a in-progress quiz submissions don't fulfill 'must_submit'
test plan:
 - with and without draft state,
  - as a teacher,
   - create and publish a quiz that allows multiple submissions
   - put the quiz in a module
   - set up a "must submit the assignment" requirement
  - as a student,
   - go to the modules page
   - open the quiz in a new tab
   - click "Take the quiz", then don't submit
   - switch back to the browser tab containing the modules page
     and reload
    - the quiz module item should not be complete
   - switch back to the browser tab containing the quiz
     and submit it
   - return to the modules tab and reload
    - the completion requirement should be fulfilled
   - retake the quiz, but do not submit
    - the completion requirement should still be fulfilled

  - as a teacher,
   - create another quiz that allows multiple submissions
   - put the quiz in a module
   - set up a min score requirement
  - as a student,
   - take the quiz and submit, satisfying the min score
     requirement
   - retake the quiz, but do not submit
   - the module item should still be fulfilled

fixes CNVS-6369
fixes CNVS-11567

Change-Id: Iaffe514283f1a51d6ddfb488233e1a12a8a657f9
Reviewed-on: https://gerrit.instructure.com/31460
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-03-12 19:29:14 +00:00
Cody Cutrer 39ddecc5c3 remove webrat, and fix pseudonym sessions controller spec for rails 3
webrat is abandonware, and doesn't work properly with rails 3

Change-Id: I34db6c150b6715e33a30d531941b76458090ce63
Reviewed-on: https://gerrit.instructure.com/31457
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-03-06 21:19:16 +00:00
Brian Palmer 4e9f7f2808 rails3: fix issues found in integration/security_spec
Change-Id: Ic88b58865135694dd510fecec4ec21d44eea09a1
Reviewed-on: https://gerrit.instructure.com/31010
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-03-05 05:35:50 +00:00
Mark Severson 903e349c66 refactor evaluate/deep_evaluate logic
test plan:
 * full regression of all module progression functionality

closes CNVS-11505

Change-Id: I63f542d5d42f950cf9c8117e12ecce4518e2ccf4
Reviewed-on: https://gerrit.instructure.com/30983
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-03-04 20:20:27 +00:00
Cameron Matheson 55a346fcee rails3: fix failing files integration spec
Change-Id: I464f354a2f5bcc2106c01e1439ed2a2227427031
Reviewed-on: https://gerrit.instructure.com/30649
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2014-02-26 05:22:09 +00:00
Derek DeVries b8da82151c rails3: fix some security integrations specs
fixed:
- path doesn't include query params anymore, so we have to check request.fullpath
- need to replace Accept header with HTTP_ACCEPT

Change-Id: Ie1cd0ccbca3174f3788fbcb46066c27a4796569a
Reviewed-on: https://gerrit.instructure.com/30702
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
2014-02-24 21:06:25 +00:00
James Williams 7a26b534ac spec: explicitly set host in files integration spec for rails 3
Change-Id: I2585fa63345902845450515dd95a517f02a0d5b6
Reviewed-on: https://gerrit.instructure.com/30641
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-02-22 20:16:13 +00:00
Cameron Matheson 0aa6bfa78a rails3: stop testing for ErrorReport creation on 404s
We don't want these anymore, which is fortunate because they don't seem
to get created in rails3.

Change-Id: Ic6dd1e7a5dbf28cdb1e164ce9e27d7d427938f30
Reviewed-on: https://gerrit.instructure.com/30283
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2014-02-19 20:37:19 +00:00
Cameron Matheson 368c9e4696 fix X-UA-Compatible headers
RAILS3 includes these for us

Change-Id: I4ee8e558b56d167c7d15e794b5b061aabdcd41b3
Reviewed-on: https://gerrit.instructure.com/30265
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-19 20:37:13 +00:00
Mark Severson e1e466b69b fix content tag state synchronization
test plan (non-draft-state):
 - as a teacher
   * create each of the following:
     - assignment
     - discussion
     - page (hidden from students)
     - page (not hidden from students)
     - quiz (leaving it unpublished)
   * add each of the above items to a module
   * refresh the modules page
     - each of the above items should be listed
 - as a student
   * navigate to the modules page
     - the hidden page and quiz should not be listed
     - all other items should be listed
   * click on the first item in the module
   * click through each of the 'Next' buttons
     - only items listed in the module should be presented

test plan (draft-state):
 - as a teacher
   * create each of the following:
     - assignment
     - discussion
     - page
     - quiz
   * add each of the above items to a module
   * refresh the modules page
     - each of the above items should be listed
 - as a student
   * navigate to the modules page
     - only published items should be visible
   * click on the first item in the module
   * click through each of the 'Next' buttons
     - only published items should be presented

   * publishing items (as a teacher) should make them available to the
     student in the module progression as well as the modules page

closes CNVS-10831

Change-Id: Ia84e56f42438ff531a4e15784eefaec2ead8ecdd
Reviewed-on: https://gerrit.instructure.com/30312
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2014-02-19 20:36:59 +00:00
Joshua Simpson ae814421e0 namespace all of quiz into quizzes module
This commit namespaces the rest of quiz related code into a Quizzes
namespace: controllers, views, models, and classes that previously lived
under lib/ that are Quiz-related.

Test plan:

Full regression test on all quiz related items

refs CNVS-10457

Change-Id: If54b61213945056539e03271a936d233abb66188
Reviewed-on: https://gerrit.instructure.com/29351
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-02-18 22:17:13 +00:00
Derek DeVries a71d5e44b0 rails3 fix for wiki pages spec
Change-Id: Ifcaac6a4d1a5dbfdfdad0798ce0339ce53d3a46d
Reviewed-on: https://gerrit.instructure.com/30147
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
2014-02-14 15:57:09 +00:00
Braden Anderson 11f6cda875 remove while(1) from API responses to application/json requests
fixes CNVS-11055

No browsers currently include Accept: application/json on requests for
<script> resources. It would be unreasonable for them to do so,
as even JSON-P uses application/javascript. Therefore, I believe
that application/json will remain a credible signal that a request
is not JSON-hijacking CSRF.

https://developer.mozilla.org/en-US/docs/HTTP/Content_negotiation#Values_for.C2.A0_scripts

test plan:
  * make an API request with and without the header
    Accept: application/json
  * verify that while(1) is prepended to the response
      iff the header is not present
  * smoke test Canvas pages which use Ajax

Change-Id: Iae830a4870175cae2b627227c85a5f1cc7801f69
Reviewed-on: https://gerrit.instructure.com/29882
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-02-12 17:19:44 +00:00
Cody Cutrer 17d84120f5 change response.redirected_to to response.should redirect_to for rails 3
Change-Id: I919e9f1eee81c972baa97832a6599fbb340eb82d
Reviewed-on: https://gerrit.instructure.com/29805
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-11 16:35:52 +00:00
Cody Cutrer cd7b02df17 use assert_status instead of checking response.status directly
since it's not a string in rails 3

Change-Id: Ib1859a3ca241bd64ca0c43b4ccfec94ba801eab6
Reviewed-on: https://gerrit.instructure.com/29780
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>
2014-02-08 14:06:53 +00:00
Cameron Matheson 3c434e8aff Remove unused collections stuff
This was a beta api that didn't work out.

Test plan:
  canvas should still work (sorry, this touches lots of stuff)

Change-Id: I31680b83f72f6d739ce74735ba40d7a760debb33
Reviewed-on: https://gerrit.instructure.com/29506
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-02-07 19:32:46 +00:00
Joshua Simpson 1e81ea7caa move quiz into quizzes namespace as a precursor to enginifying
fixes CNVS-10679
this commit refactors quiz into a quizzes namespace. it contains various
shims to facilitate the data migration of polymorphic relationships
('Quiz' -> 'Quizzes::Quiz').  JIRA contains several tickets linked to
the above tickets in regards to removing these shims after the data
migration, as well as the strategies on reverting the shims once the
data migration is complete.
Change-Id: I30c566d60a87af6ee83e9d0041fdcb909ead6a89
Reviewed-on: https://gerrit.instructure.com/28573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-01-24 00:08:46 +00:00
Cody Cutrer cc93da5b8c integration specs are request specs in rspec2
Change-Id: Iffee4243a9fa27e43f7020919a18777031e9724f
Reviewed-on: https://gerrit.instructure.com/28833
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-01-21 19:29:58 +00:00
Brian Palmer 6aa6db8610 spec: fix some travis spec errors
Attempt to fix our sis batch tempfile usage, which wasn't compatible
with the travis environment.

Found more SAML specs to mark as pending when SAML isn't enabled.

Use webmock instead of our own home-grown solution, since Travis
enforces webmock.

Select only the users we're interested in sorting, to remove dependency
on empty db.

refs CNVS-10467

Change-Id: Icf9b093c6cc4a6b7b19da9dd2abab9f39457f817
Reviewed-on: https://gerrit.instructure.com/28949
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-01-21 19:17:39 +00:00
Mark Severson 0152fa52fa deprecate hide_from_students on wiki pages
hide_from_students is being deprecated in lieu of the workflow states
'active' (published) and 'unpublished'

test plan: (draft state and legacy)
  special attention should be given to areas related to hiding wiki
  pages from students (legacy: hide from students checkbox;
  draft state: published/unpublished items)

  items that are hidden from students or unpublished should show for
  teachers, but should not show for students

 - areas to test:
   - pages api and ui (regression)
     - validate hide_from_students and published values in all api calls
   - course migrations (specifically course copy)
   - wiki sidebar in other parts of canvas

fixes CNVS-10354, CNVS-10366

Change-Id: I70f4d8c07c2be4150163279f0673377bad6e9c48
Reviewed-on: https://gerrit.instructure.com/28375
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-01-15 21:29:06 +00:00
Mark Severson f5c6aa8154 fix default front page behavior
test plan:
 - on a new course (with draft state disabled)
 * click on 'Pages' in the left nav
   - shows edit form for a new 'Front Page'
 * enable draft state for the course
 * click on 'Pages' in the left nav
   - should indicate no pages have been created
   - should allow the creation of a new page

 - on a course (with draft state enabled)
 * navigate to an existing wiki page
	 * click 'Edit'
	 * click 'Cancel'
   - should be redirected to a view of the same page
 * navigate to a non-existent page (manually changing url)
   - shows the edit form for the page
   * click 'Cancel'
   - should be redirected to the pages index

additional test considerations:
 - this affects behaviors around the default page named 'Front Page' on
   new courses (specifically when draft state is disabled). testing of
   related behaviors should be tested (especially the api).

fixes CNVS-10269

Change-Id: I11c7b65b004922e76f680afdece1ddcb65d542e3
Reviewed-on: https://gerrit.instructure.com/28081
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2014-01-10 16:04:28 +00:00
Jeremy Stanley d01026cf37 decouple grading rights from create/update rights
test plan:
 - create a custom role based on TA
 - deny "Manage (add/edit/delete) assignments and quizzes" to it
 - deny "Manage all other course content" to it
 - keep "Edit grades" and "View all grades" allowed
 - enroll a user with this custom role
 - make sure the user can grade assignments and quizzes
 - make sure the UI elements to create, edit, and delete modules,
   assignments, and quizzes are not shown to this user
   - with draft state disabled
   - with draft state enabled;
   - from the Assignments/Quizzes/Modules page, and also
   - the ability to create an assignment or quiz via module item.
 - make sure that attempts to create, edit, and delete
   quizzes via the API are denied

fixes CNVS-1481

Change-Id: Ic4056f709d48c40b2804aef52a4a1aafc44b5122
Reviewed-on: https://gerrit.instructure.com/27187
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>
2013-12-12 17:56:23 +00:00
Brian Palmer 2fb77a4651 be explicit about enforce_available_locales
To stop the gem printing a warning about the changing default

Change-Id: Ia284e5518078dff45d59f0687311e0b32e237ba6
Reviewed-on: https://gerrit.instructure.com/26956
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-12-04 23:04:15 +00:00
Jeremy Stanley dcf3df456b move draft state under feature flag umbrella
fixes CNVS-9496

test plan:
 - draft state feature should show up in site admin feature
   flags, or root account feature flags when called as site
   admin
 - when site admin hits "allow" for the feature, it should
   appear in the root account administrator's settings
   in "Off" state
 - the root account admin should be able to "Allow" the setting
   which allows a sub-account or course to turn it on
 - when the feature is turned on via the Feature Settings tab
   or features API, draft state functionality should appear
   in the course wiki pages and elsewhere

Change-Id: Id7403f2a8371b0a7bfebffbb8f29330fff5c94c5
Reviewed-on: https://gerrit.instructure.com/26308
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2013-11-26 20:43:49 +00:00
Josh Simpson b5b627efa6 Quiz question refactor / api implementation
fixes CNVS-7982
Changes parsing mechanisms for question data, and adds
API for quiz questions.

Change-Id: I483fc9c4718af50e1bed2ee3547905f857de6285
Reviewed-on: https://gerrit.instructure.com/25346
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2013-11-22 17:03:45 +00:00