refs CNVS-9522
replace our hokey ActiveRecord::Base.suspend_callbacks implementation
with something that integrates nicely with ActiveSupport::Callbacks in
general, as a gem.
include it into ActiveRecord::Base and use it to implement
save_without_callbacks for rails3 (rails2 still needs to do it the way
we had it before, because the notifications callback isn't handled
through ActiveSupport::Callbacks).
test-plan:
- make sure ActiveRecord callbacks still run in most cases (e.g. after
creating a course through the UI, it should have a value in the uuid
column in the database)
- make sure callbacks don't run while suspended (e.g. have a user
enrolled in two courses. call user.delete_enrollments. both
enrollments should be deleted, but only one delayed job for due date
caching should be created)
Change-Id: Iecd1cc0346e218261677d16ee44bae9cb9149ddd
Reviewed-on: https://gerrit.instructure.com/29809
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
this was used by collections (which no longer exist)
Test plan:
make sure there are no references to embedly on the account settings
page
Change-Id: Ia599877523a26560392ca554a2e760930f65deb6
Reviewed-on: https://gerrit.instructure.com/30148
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
things fixed:
- erubis is in actionpack gemspec in rails3, so we don't need it in the gemfile
- don't directly initialize a SafeBuffer, and instead initialize OutputBuffer
- Fix comparison of hash with indifferent access in quizzes spec
- plugins in rails3 aren't loaded in init.rb so rails_xss is still being
loaded in rails3. However we have parts of the code that actually reference
rails_xss classes directly so we want to keep the RailsXss::Erubis constant
defined in erubis.rb. However we don't want to actually monkey patch
the activesupport or string methods anymore for xss (rails3 takes care of
this for us)
Change-Id: I327bf042dfa7dcedd39acb463eda1420d3dbd98c
Reviewed-on: https://gerrit.instructure.com/30108
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
adds error_messages and error_messages_for helpers
Change-Id: I209ed14a0b764190b3f06e5d107a4261144a25a8
Reviewed-on: https://gerrit.instructure.com/30015
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
also refactored add_variable_mapping to be more explicit
Change-Id: I38b21975ae80cf510f81bfba84ece7b3b568bfa9
Reviewed-on: https://gerrit.instructure.com/29241
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Brad Humphrey <brad@instructure.com>
* vendoring gems to allow the gems that we own to reference a locked
* down version in their gemspecs. Specifically, with the old version of
* ActiveSupport that we were getting from the LTS Rails repo, there is
* no way to tell bundler to install a gem that is a subdirectory of a
* git repo.
Change-Id: I32d9d0fae15da1fcf27f11e5cd8fca26af18d383
Signed-off-by: David Julia <djulia@pivotallabs.com>
Reviewed-on: https://gerrit.instructure.com/29438
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
Please enter the commit message for your changes. Lines starting
Change-Id: I633d3e9849cb750010591bc6a46897b3f148bb3e
Reviewed-on: https://gerrit.instructure.com/29467
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
Change-Id: I89bb7ec9d688ac5ff4d72746c423f5c1231867d9
Reviewed-on: https://gerrit.instructure.com/29314
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
QA-Review: Paul Hinze <paulh@instructure.com>
fixes PS-1006
test-plan
test with g/28553
creds found in PS-954
training center and meeting center meetings should work
Change-Id: Ibac8b863f5295671cb2e852e26b89eb8b7ed91ce
Reviewed-on: https://gerrit.instructure.com/28556
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
The gem still lives in the canvas-lms repo, but has separate tests, and
knows nothing about Canvas proper. Canvas' usage of the gem is through
Canvas::Cassandra::DatabaseBuilder (and Canvas::Cassandra::Migration).
Change-Id: I51878055647225755d54edc5595b8189b7bea3cc
Signed-off-by: Stephan Hagemann <stephan.hagemann@instructure.com>
Reviewed-on: https://gerrit.instructure.com/28632
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
in rails 3, ActionController::TestUploadedFile has
been moved to Rack::Test::UploadedFile. This commit
simply updates uses of TestUploadedFile to work
with this new structure
Change-Id: Ib31159c635f033a13908608dffeea88c8f719086
Reviewed-on: https://gerrit.instructure.com/28234
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
to get ruby 2.1 as a platform for the gemfile
also make the gemfile stricter (and more helpful) on bundler version
mismatch (it used to not check the bundler version requirement if
the rest of the bundle checked out)
Change-Id: I1cc5122f3b2f0ea212a5cfd2259308026efb0f50
Reviewed-on: https://gerrit.instructure.com/27891
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>
kaltura is always available over https, and requesting a secure resource
from within a plain http page is not harmful.
so we can simplify the code and pave the way for a media service that
only runs over https by converting everything to request kaltura
resources via https.
to accomplish this we pull together all of the myriad ways that HTTP
requests were being made from canvas's kaltura client. then in the
unified code path we ensure SSL is being used to make requests.
we're also pulling in webmock to make for better tests of the kaltura
client code with stubs closer to the HTTP layer.
unfortunately this change ends up touching most of kaltura
functionality, so the test plan is basically a full kaltura regression
test.
test plan:
- upload a video to kaltura; once it's done transcoding, the thumbnail
should work, and the video should play
- upload a video via canvas files, then embed it in some content; do
the same verification
- record a video using your webcam; verify it works
Change-Id: If5f67469fee07db80188911a0c7edd256c94c0a3
Reviewed-on: https://gerrit.instructure.com/28100
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
test plan:
it should let you create a non scheduled conference
Change-Id: Ie64484def007511dad7da69ab8eecb7f6a11c5e1
Reviewed-on: https://gerrit.instructure.com/27715
Reviewed-by: Brandon Broschinsky <brandonbr@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Change-Id: I8edb984d3886915415b88687d78db4fa917c2be4
Reviewed-on: https://gerrit.instructure.com/27903
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
test plan:
- The quiz api should work like it normally does when you don't pass
an 'Accept: application/vnd.api+json' header.
- The quizzes index page and quiz edit page should work like they
always do.
- Testing the Quizzes API for "jsonapi" style:
- For all requests, you MUST have the "Accept" header set to
"application/vnd.api+json"
- Test all the endpoints (PUT, POST, GET, INDEX, DELETE) like you
normally would, except you'll need to format the data according to
the next few steps:
- For "POST" and "PUT" (create and update) requests, you should send
the data like: { "quizzes": [ { id: 1, title: "blah" } ]
- For all requests (except DELETE), you should get back a response
that looks like: { "quizzes": [ { quiz you requested } ]
- For the "delete" action, you should get a "no content" response
and the request should be successful
Change-Id: Ie91deaeb6772cbe52a0fc46a28ab93a4e3036061
Reviewed-on: https://gerrit.instructure.com/25997
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
stops using the decorator strategy for instantiating pages from active
record scopes/relations, since this left us with decorated arrays that
failed Array === page. instead, the pages are instances of a subclass of
Array, so that Array === page passes.
test-plan:
- in script/console:
User.where(id: User.paginate(page: 1, per_page: 3)).to_sql
- should be 'SELECT * FROM "users" WHERE ("users"."id" IN (1,2,3))'
instead of 'SELECT * FROM "users" WHERE ("users"."id" = 1,2,3)'
Change-Id: Ia2ea4adbdbf96f55af4be53d3f83f0b5815a5cdf
Reviewed-on: https://gerrit.instructure.com/27617
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
primarily switching fullpath in place of request_uri
in preparation for rails 3
Change-Id: If14f2cc2da5120a60f04d4cfdfb05a55482a3695
Reviewed-on: https://gerrit.instructure.com/27162
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
fixes CNVS-10092
test plan:
* create a new adobe connect conference;
* start the conference;
* reload the conferences page in canvas and verify
that it loads without an error.
Change-Id: Iba63fe121138295e589f8f099c8f27cb4d06c9b7
Reviewed-on: https://gerrit.instructure.com/27720
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
Change-Id: Ib2147e2a5c388ba56c1e558b414da9b7ec4c9cd2
Reviewed-on: https://gerrit.instructure.com/27614
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
refs PS-894
test-plan:
requires g/27337 to test functionality
* conferences should behave the same without g/27337
Change-Id: I546e806897fa35bc93b983da2d149e312f502d2d
Reviewed-on: https://gerrit.instructure.com/27338
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
railtie initializers are not run after the initialization
process has begun, so 'folio/rails' needs to be required
beforehand
Change-Id: Idcc4d1493dfaa63356b6f7461b7adc24b5ff6fe9
Reviewed-on: https://gerrit.instructure.com/27575
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
refs CNVS-8795
fixes CNVS-8796
the will_paginate view helper will handle non-ordinal and open-ended
collections now, without hacks around the total_entries value.
test-plan:
- load the error reports page
- should load
- should be paginated
- first page should have the most recent reports
- first page should not have a "previous" link
- first page should have a "next" link (assuming >1 pages worth of
reports)
- second page should have a "previous" link
- second page should have a "next" link (assuming >2 pages worth of
reports)
- last page should not have a "next" link
Change-Id: I776b3a1b78267722a47932aa7849593f10938e52
Reviewed-on: https://gerrit.instructure.com/27125
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
Change-Id: I824d723c5325fa2f97e0d1ce564d9e22f4e3b6f7
Reviewed-on: https://gerrit.instructure.com/27099
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
moves the load account and session timeout plugin middleware
to set the expire_after before the session store is called,
and changes encrypted_cookie_store to use that option so it can
invalidate expired sessions when it unmarshals the data
for the first time.
The reason it seemed to work locally is because it sets
@options[:expire_after] after the first request.
Unfortunately this second time doesn't often happen
in the actual application when distributed amongst several
instances.
test plan:
* set the "Sessions" plugin settings to timeout after
1 minute using the following console commands;
ps = PluginSetting.
find_or_create_by_name_and_account_id("sessions",
Account.default)
ps.settings = {"session_timeout" => "1"}
ps.disabled = false
ps.save!
* (Note: normally this would be done
by going through the plugin settings ui, however, it enforces
a minimum of 20 minutes, which is difficult to test with)
* start the server and log-in
* shut down the server
* wait for 1 minute for the session to time out
* restart the server and try to click a link
* should be redirected to the log-in page
fixes #CNVS-7870
Change-Id: I843b73da7d3c001f7e632b1454c63f9d6c07f73d
Reviewed-on: https://gerrit.instructure.com/26911
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
this is a partial revert of 89ec8993
i18nema was disabled during some intermediate upgrade work around 3.0, due
to that version of rails needing an older version of the i18n gem
test plan:
1. canvas should fire up
2. you should be able to run i18nema-specific stuff in the console, e.g.
> I18n.backend.direct_lookup('en', 'date', 'formats', 'default')
=> "%Y-%m-%d"
Change-Id: Ib1f7e03c417cc87fd873a7434a4586969470b58b
Reviewed-on: https://gerrit.instructure.com/26975
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
Change-Id: I7d738058c4f69d07e8e81035e4a513a95de62d50
Reviewed-on: https://gerrit.instructure.com/26361
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>