Commit Graph

26 Commits

Author SHA1 Message Date
Cody Cutrer 8f8f6f7313 bump rubocop gems and apply changes
[skip-stages=Flakey]

Change-Id: I5f080be6efb64351b4a89e6bd6040bc6f0432e82
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/323854
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-08-07 20:13:35 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:03:06 +00:00
Cody Cutrer e73cf9ddf4 RuboCop: Style/HashSyntax
[skip-stages=Flakey]

auto-corrected

Change-Id: I9371a61046aee6b148f89dd434114a8ba2b1188c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:02:35 +00:00
Cody Cutrer c4bc112611 RuboCop: Style/MethodCallWithoutArgsParentheses
[skip-stages=Flakey]

auto-corrected

Change-Id: Idcbd419ab2196101398715e6b8cdd8d70ae5c587
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278698
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:07:30 +00:00
Cody Cutrer a690e90aa8 RuboCop: Style/RedundantReturn
[skip-stages=Flakey]

auto-corrected

Change-Id: Ic472ca1cc04423fc966cd4a1ead467604d2904fc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278130
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-12 16:33:45 +00:00
Cody Cutrer 06a2c9df42 spec: remove manual requires of spec_helper
[skip-stages=Flakey]

Change-Id: Id65c835b72e1c0a4bb825b58490ce0ff7c8d9873
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276829
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-26 20:38:27 +00:00
Cody Cutrer b6e406ddcf RuboCop: RSpec/ExampleWording
[skip-stages=Flakey]

Change-Id: I291432cd1f51fdaefb3cf6160d423879fb858c11
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274253
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-24 02:15:35 +00:00
Cody Cutrer 6b0095610c RuboCop: Layout spec
[skip-stages=Flakey]

Change-Id: Id479617328562fd009f00db27f248c2ebafa4b7a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274151
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2021-09-22 22:40:24 +00:00
Cody Cutrer 81d0bbc465 add # frozen_string_literal: true for specs
Change-Id: Id508bec1817937b1c24c29f1db7221e09cb9c2ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251157
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:48:35 +00:00
Cody Cutrer 79d0785a49 encoding has defaulted to UTF-8 for a long time; don't need a magic comment for it
Change-Id: Ife4d6b76d63fff14897421b58d9fcea8f423311c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251163
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-26 21:26:20 +00:00
Rob Orton 777ba1f30d delete scribd
Change-Id: I20d2b6f522a742d220f4263e4d53353bbd996671
Reviewed-on: https://gerrit.instructure.com/146125
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2018-04-10 17:39:52 +00:00
Cody Cutrer f5fbc0b69d spec: mocha => rspec-mocks for initializers
Change-Id: Icaf253908a7b66c80878ca133bd758d52dfe5447
Reviewed-on: https://gerrit.instructure.com/120500
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 00:18:20 +00:00
Landon Wilkins 0ce4a23f58 da licença part 46
add consistent license headers to all source files

Change-Id: If9d3b01addc4fd9c2977bf2402dda57ec622e72f
Reviewed-on: https://gerrit.instructure.com/110151
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:56:22 +00:00
Jon Jensen 5b544a57cf spec: clean up spec_helper.rb a little bit
baby steps

Change-Id: I70220768acaea672f68c8f33801cd69e10328be5
Reviewed-on: https://gerrit.instructure.com/100276
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-01-24 17:32:32 +00:00
James Williams 264db4b1b1 remove unnecessary utf8 cleaning on serialized columns
they were all cleaned by the psych migration

closes #CNVS-28871

Change-Id: I788a68900e6e3fc6371331ab9f4bf37035a664c8
Reviewed-on: https://gerrit.instructure.com/77584
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-04-22 18:20:36 +00:00
James Williams f62911d1d2 rails 4.2: fix initializer specs
refs #CNVS-26056

Change-Id: I6bd8f15c375afc1bbb49d156949c1a92bd1c01d3
Reviewed-on: https://gerrit.instructure.com/70497
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-01-20 15:18:12 +00:00
Cody Cutrer 26115c7423 rspec 3-ify spec/initializers
refs CNVS-16239

Change-Id: Ida6f59824f8171e67f0bf3a02ce88ec6c0b0e9ac
Reviewed-on: https://gerrit.instructure.com/42663
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <braden@instructure.com>
Product-Review: Braden Anderson <braden@instructure.com>
QA-Review: Braden Anderson <braden@instructure.com>
2014-10-13 23:10:35 +00:00
Cody Cutrer 9d2a1786f6 fix encoding issue in spec for ruby 2.1.3
Change-Id: If2c4b22451272111577f03b891ac91e5a9c01d6b
Reviewed-on: https://gerrit.instructure.com/42283
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2014-10-08 19:48:23 +00:00
Raphael Weiner 66e4ee8e66 create utf8_cleaner gem
test plan:
  * run specs

Change-Id: Ic2a76e3c6290c06f68f06796babbdc5ff3b405d9
Reviewed-on: https://gerrit.instructure.com/29733
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-03-25 21:56:33 +00:00
Anthus Williams 40c5c1f5f7 fix for rails3 refactoring of TestUploadedFile
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>
2014-01-17 17:53:18 +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 e1a85c2f5f get rid of transliterate warnings in ruby 1.9
Rails 2.3 decided to warn every time this method is called when on Ruby
1.9 -- and this method is called lots of times every request. We don't
actually put non-ascii text in URLs but I switched to using
I18n.transliterate rather than a no-op anyway, since that's what Rails 3
does.

fixes CNVS-4864

test plan: generating urls from routes should still work (you can test
this by loading most any page in canvas), and you shouldn't see warnings
in the log: "Ruby 1.9 doesn't support Unicode normalization yet"

Change-Id: Ie99425bb04989c3d671e6761ee519f4cce66cd01
Reviewed-on: https://gerrit.instructure.com/18721
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-03-22 23:03:47 +00:00
Brian Palmer 64741c61b8 patch ERB::Util.html_escape to not print warnings in ruby 1.9
This was spewing mad warnings every time the method was run, because
ruby doesn't like applying the //n regex option to utf-8 strings.

test plan: specs should pass, naming your user to something like "<&>'"
should escape properly on display, same as before.

Change-Id: I72c27fdc1ec025f0707c002f2e38d15cbdf2c61d
Reviewed-on: https://gerrit.instructure.com/18379
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-03-07 15:44:16 -07:00
Bryan Madsen cfa841e7e4 spec: pend utf8 spec in ruby 1.8
fixes #CNVS-4458

Change-Id: I36000bbabf9535df11e8df10bd106f012f6b35c2
Reviewed-on: https://gerrit.instructure.com/18372
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-03-06 22:20:03 -07:00
Brian Palmer 54f43dd81d don't raise an error if an uploaded file has no original filename
Browsers tend to send a filename, but some API clients don't.

fixes CNVS-4233

test plan: do a multipart file upload to an api endpoint, such as a sis
api, and leave out the filename=/original/filename component of the
parameter. the upload should still be accepted and no error raised.

Change-Id: I9be8d425693cfb9d8d44644e57358f5dc9cee4c1
Reviewed-on: https://gerrit.instructure.com/18114
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-02-28 10:36:39 -07:00
Brian Palmer d7bac4a190 fix for a ruby 1.9 warning message
Backported from ruby 2.0 (and possibly later 1.9 patchlevels) because it
was filling our logs with many millions of warnings. The code was
backported directly, the test was backported with conversion from
minitest -> rspec.

test plan: Delayed jobs that use ruby's net libraries should still work,
such as sending messages, taking web snapshots, etc. You shouldn't see
any further lines like this in the log:

net/protocol.rb:313: warning: regexp match /.../n against to UTF-8 string

Change-Id: Ic29daa4ee9f0587fb2a1ac2968cd08a2f68365a1
Reviewed-on: https://gerrit.instructure.com/17431
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-02-05 08:32:30 -07:00