Commit Graph

17 Commits

Author SHA1 Message Date
Cody Cutrer f47e524f0f spec: mocha => rspec-mocks for controllers
Change-Id: I814a91c7209d7ddb00357d12d3546711a5122fe3
Reviewed-on: https://gerrit.instructure.com/120603
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-07-26 20:40:52 +00:00
James Williams 69132ab870 spec: rails 5.1: rewrite controller spec format - part M-P
Change-Id: I1eee577904575079654943b19fc990d2929ad9c6
Reviewed-on: https://gerrit.instructure.com/120224
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-07-25 16:20:11 +00:00
James Williams 4fe9bba72c spec: rails 5.1: rewrite controller spec format - part B-C
Change-Id: I33c8ca114c32d09a00352a28724bd46624600be4
Reviewed-on: https://gerrit.instructure.com/120135
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-07-25 16:19:32 +00:00
Landon Wilkins 41385e29e7 da licença part 45
add consistent license headers to all source files

Change-Id: I29fdb6dbff5bb4d0e0d7c0ffeea422faaf6a4afa
Reviewed-on: https://gerrit.instructure.com/110150
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-28 17:53:35 +00:00
Simon Williams 6c8310bf10 fix csv limit for pv4 page view csv report
fixes CNVS-29202

test plan:
- general regression test of csv exports
- with pv4 enabled, and 'page_views_csv_export_rows' set to >200, you
should get the right number of rows back

Change-Id: I0d8e733ef3ef7d7c7c50462f3d95539157da82c0
Reviewed-on: https://gerrit.instructure.com/81056
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2016-06-03 16:12:36 +00:00
Cody Cutrer f64a73a99f display app name in page view output
closes CNVS-28788

test plan:
 * enable page views
 * use an app (such as Canvas for iOS) to interact with your
   Canvas, and record page view (particularly ones that count
   as "participations")
 * look at the page views for the user
 * instead of listing a browser for the user agent, it should
   list the name of the developer key for the app

Change-Id: Id07b293db333e44db7110fc2620409535927f915
Reviewed-on: https://gerrit.instructure.com/77409
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-05-02 21:25:54 +00:00
Cody Cutrer d414b19a1d fix passing time restrictions through to pv4
apparently we like to change param names halfway through the stack

test plan:
 * enable pv4
 * do an api request for pv4 data, passing start_time and end_time
 * it should work

Change-Id: I3fdc7c9105af5f45a2380f15981be03e91caed55
Reviewed-on: https://gerrit.instructure.com/74413
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-03-14 20:01:58 +00:00
Simon Williams 0778968976 don't double render on page view cassandra error
closes CNVS-25561

test plan:
- enable page views to point to cassandra, but don't configure cassandra
- log a page view
- it should not write 2 errors to ErrorReport

Change-Id: I19281d39023eebcc498ddc5820dfbb8c13225805
Reviewed-on: https://gerrit.instructure.com/68254
Tested-by: Jenkins
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-12-29 18:04:57 +00:00
Cody Cutrer bd9ba4e545 rspec 3-ify spec/controllers
refs CNVS-16239

Change-Id: I063c25c1481deb634c652f6b45e75b63c7f4dcd3
Reviewed-on: https://gerrit.instructure.com/42677
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-10-14 16:34:30 +00:00
Jon Jensen 10e5fe6596 spec: once-ler spec/controllers/[m-q]*
reduce runtime ~45% (4:46 -> 2:34)

Change-Id: If1190222d3077dabe62b8cba1b929f4855aad146
Reviewed-on: https://gerrit.instructure.com/38669
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2014-08-04 16:18:20 +00:00
Cody Cutrer a389fd18c1 rails 3 doesn't auto-require csv, so require it where necessary
Change-Id: Id76980c82024a082855f5b7b5b60cd7e760730a9
Reviewed-on: https://gerrit.instructure.com/30132
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-14 16:04:34 +00:00
James Williams d9ae1efd2c spec: replace it_should_behave_like with include_examples
Change-Id: I8a10679218b9a6ff8485b7822a21c704bdfaa398
Reviewed-on: https://gerrit.instructure.com/29213
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>
2014-01-24 16:02:26 +00:00
Brian Palmer 31f33164b5 remove 1.8 compatibility shims
- update the Gemfile to be 1.9 only, and raise an exception on wrong
  ruby version
- remove RUBY_VERSION checks, replacing with the applicable code
- remove the FasterCSV compatibility shim, just use CSV now

test plan: trying to bundle install on ruby 1.8 or 2.0 should raise an
exception, specs should pass, canvas should work as normal on 1.9

Change-Id: I49088e9d227c59c6d5d5acb417c2df971129474a
Reviewed-on: https://gerrit.instructure.com/19806
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-03 01:43:52 +00:00
Brian Palmer cc1954e0e6 fix permissions check for UsersController#show
This needs to check the user, not the account, but we no longer grant
:view_statistics if a user has :read_reports on a course, effectively
blocking teachers from viewing the top-level user page by default.

A new user-level :read_reports permission was added so that teachers and
account admins can still view the teacher/student interaction reports as
before, even though teachers don't have :view_statistics

fixes CNVS-2964

test plan:
- a site admin user should be able to view /users/X on any account
- an account admin user should be able to view /users/X for students in
  thier account, but not in other accounts
- a teacher should not be able to view /users/X for a student in their
  course Y, but they should be able to view /courses/Y/users/X

Change-Id: Iebc639bd935f50344cb77614f6eeae2bacb421e2
Reviewed-on: https://gerrit.instructure.com/18473
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-03-09 17:59:03 -07:00
Brian Palmer 005e42a757 cassandra store for page views
Adds a new back-end store for page_views, using a Cassandra cluster. All
the current page view queries are supported, many using denormalized
views on the data.

test plan:

first, canvas instances that are currently using AR page views
should function as before.

by Setting.set('enable_page_views', 'cassandra') and restarting, you will
switch to cassandra page views. a script to migrate the AR page views to
Cassandra is coming. all page view functionality should work as before.
note that the format of the pagination headers in the
/api/v1/users/X/page_views endpoint has changed.

Change-Id: I2d1feb4d83b06a0c852e49508e85e8dce87507b4
Reviewed-on: https://gerrit.instructure.com/14258
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-24 17:23:56 -06:00
Jacob Fugal 1687933ff3 make page views specs more lenient about summarized
Change-Id: I1bbb0c40cbc95f96a99e2c2b32385a4b647518f7
Reviewed-on: https://gerrit.instructure.com/11024
Tested-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2012-05-25 09:49:47 -06:00
Mark Ericksen 3720aee2a3 Order user's PageView list as CSV with most recent first. Fixes #7474
The CSV requested data was unordered but limited to 300. So CVS list did not
 always included expected data or in a predictable order. Added a named_scope
 and use it to give explicit ordering. In the process of working on this, I
 discovered that the "xml" link next to "csv" has no code backing it up and thus
 returns a blank page. Talked with Jon and determined to just delete the link.

 Test Plan:
 * enable page_views in settings (in order to see in UI)
   * ex: Setting.set('enable_page_views', 'db')
 * setup a user with page views that are not in chronological order
 * view the list at /accounts/?/users/?
 * html display version should be listed chronological order with most
   recent listed first (was correct before)
 * csv link downloads data and it should be in the same order
   and the same set of data.

 The easiest testing approach for CSV ordering is to review and run the
 new spec.

Change-Id: I004b10548fdcaffa795cc497aba93cfdda2eac82
Reviewed-on: https://gerrit.instructure.com/10534
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2012-05-09 16:19:52 -06:00