rubocop: Layout

addresses minor changes in cops in rubocop 1.49

[skip-stages=Flakey]

Change-Id: I79503c905f59752d67391e70909e73441323faee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315160
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2023-04-04 13:51:35 -07:00
parent e99e8c0049
commit dbfff50c2d
66 changed files with 183 additions and 188 deletions

View File

@ -739,7 +739,7 @@ class AuthenticationProvidersController < ApplicationController
if aac.auth_type != data[:auth_type]
render(json: {
message: t("no_changing_auth_types",
"Can not change type of authorization config, "\
"Can not change type of authorization config, " \
"please delete and create new config.")
},
status: :bad_request)

View File

@ -61,7 +61,7 @@ class GradebookUploadsController < ApplicationController
js_env gradebook_env(@progress)
render :show
else
flash[:error] = t(:no_file_attached, "We did not detect a CSV to "\
flash[:error] = t(:no_file_attached, "We did not detect a CSV to " \
"upload. Please select a CSV to upload and submit again.")
redirect_to action: :new
end

View File

@ -101,7 +101,7 @@ module Lti
def update_workflow_state(workflow_state)
Rails.logger.info do
"in: ToolProxyController::update_workflow_state, tool_id: #{@tool_proxy.id}, "\
"in: ToolProxyController::update_workflow_state, tool_id: #{@tool_proxy.id}, " \
"old state: #{@tool_proxy.workflow_state}, new state: #{workflow_state}"
end
@tool_proxy.update_attribute(:workflow_state, workflow_state)

View File

@ -138,8 +138,8 @@ class AssessmentQuestion < ActiveRecord::Base
rescue => e
new_file = nil
er_id = Canvas::Errors.capture_exception(:file_clone_during_translate_links, e)[:error_report]
logger.error("Error while cloning attachment during"\
" AssessmentQuestion#translate_links: "\
logger.error("Error while cloning attachment during " \
"AssessmentQuestion#translate_links: " \
"id: #{self.id} error_report: #{er_id}")
end
new_file&.save

View File

@ -161,9 +161,7 @@ class AssetUserAccessLog
# us to a state where we can make claims about how far into the postgres partitions
# we've advanced, and so is allowed to zero this state out after it updates the
# global postgres state above for this shard "max_log_ids".
temp_root_account_max_log_ids: {
}
temp_root_account_max_log_ids: {}
}
output_metadatum = CanvasMetadatum.get(METADATUM_KEY, default_metadatum)
# make sure if we have prior storage without this key that

View File

@ -31,8 +31,8 @@ class BrandConfig < ActiveRecord::Base
before_validation :generate_md5
before_update do
raise "BrandConfigs are a key-value mapping of config variables and an md5 digest "\
"of those variables, so they are immutable. You do not update them, you just "\
raise "BrandConfigs are a key-value mapping of config variables and an md5 digest " \
"of those variables, so they are immutable. You do not update them, you just " \
"save a new one and it will generate the new md5 for you"
end

View File

@ -1642,7 +1642,7 @@ class DiscussionTopic < ActiveRecord::Base
case elem
when Attachment
item.guid.content = link + "/#{elem.uuid}"
url = "http://#{HostUrl.context_host(elem.context)}/#{elem.context_url_prefix}"\
url = "http://#{HostUrl.context_host(elem.context)}/#{elem.context_url_prefix}" \
"/files/#{elem.id}/download#{elem.extension}?verifier=#{elem.uuid}"
item.enclosure = RSS::Rss::Channel::Item::Enclosure.new(url, elem.size, elem.content_type)
when MediaObject
@ -1652,7 +1652,7 @@ class DiscussionTopic < ActiveRecord::Base
content_type = "audio/mpeg" if elem.media_type == "audio"
size = details[:size].to_i.kilobytes
ext = details[:extension] || details[:fileExt]
url = "http://#{HostUrl.context_host(elem.context)}/#{elem.context_url_prefix}"\
url = "http://#{HostUrl.context_host(elem.context)}/#{elem.context_url_prefix}" \
"/media_download.#{ext}?type=#{ext}&entryId=#{elem.media_id}&redirect=1"
item.enclosure = RSS::Rss::Channel::Item::Enclosure.new(url, size, content_type)
end

View File

@ -10,7 +10,7 @@
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
Pathname.new(__FILE__).realpath)
require 'rubygems'
require 'bundler/setup'

View File

@ -11,6 +11,6 @@ end
require 'pathname'
expanded_path = Pathname.new(__FILE__).realpath
APP_PATH = File.expand_path('../../config/application', expanded_path)
APP_PATH = File.expand_path('../../config/application', expanded_path)
require_relative '../config/boot'
require 'rails/commands'

View File

@ -25,8 +25,8 @@ module CanvasErrors
let(:job) do
double(
id: 42,
source: "controller:discussion_topics_api,action:add_entry,"\
"hostname:app010001063068-vpc.us-east-1.canvas.insops.net,"\
source: "controller:discussion_topics_api,action:add_entry," \
"hostname:app010001063068-vpc.us-east-1.canvas.insops.net," \
"pid:8949,context_id:c5ec694d-1c0d-4744-a97a-cae44c477837",
attempts: 1,
strand: "thing",

View File

@ -31,8 +31,8 @@ describe CanvasSecurity do
expires = 1.hour.from_now
token = CanvasSecurity.create_jwt({ a: 1 }, expires)
expected_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9."\
"eyJhIjoxLCJleHAiOjEzNjMxNjk1MjB9."\
expected_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9." \
"eyJhIjoxLCJleHAiOjEzNjMxNjk1MjB9." \
"VwDKl46gfjFLPAIDwlkVPze1UwC6H_ApdyWYoUXFT8M"
expect(token).to eq(expected_token)
end
@ -40,8 +40,8 @@ describe CanvasSecurity do
it "generates a token without expiration" do
token = CanvasSecurity.create_jwt({ a: 1 })
expected_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9."\
"eyJhIjoxfQ."\
expected_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9." \
"eyJhIjoxfQ." \
"Pr4RQfnytL0LMwQ0pJXiKoHmEGAYw2OW3pYJTQM4d9I"
expect(token).to eq(expected_token)
end
@ -108,10 +108,10 @@ describe CanvasSecurity do
describe ".base64_encode" do
it "trims off newlines" do
input = "SuperSuperSuperSuperSuperSuperSuperSuper"\
input = "SuperSuperSuperSuperSuperSuperSuperSuper" \
"SuperSuperSuperSuperSuperSuperSuperSuperLongString"
output = "U3VwZXJTdXBlclN1cGVyU3VwZXJTdXBlclN1cGVy"\
"U3VwZXJTdXBlclN1cGVyU3VwZXJTdXBlclN1cGVy"\
output = "U3VwZXJTdXBlclN1cGVyU3VwZXJTdXBlclN1cGVy" \
"U3VwZXJTdXBlclN1cGVyU3VwZXJTdXBlclN1cGVy" \
"U3VwZXJTdXBlclN1cGVyU3VwZXJMb25nU3RyaW5n"
expect(CanvasSecurity.base64_encode(input)).to eq(output)
end

View File

@ -76,8 +76,8 @@ describe AcademicBenchmark::Converter do
"label" => nil,
"statement" =>
{ "descr" =>
"Locating on a map major battle sites of the American Revolution," \
" including the battles of Lexington and Concord, Bunker Hill, Saratoga, and Yorktown" },
"Locating on a map major battle sites of the American Revolution, " \
"including the battles of Lexington and Concord, Bunker Hill, Saratoga, and Yorktown" },
"disciplines" => { "subjects" => [{ "code" => "SOC" }] },
"utilizations" => [{ "type" => "alignable" }] },
"type" => "standards",

View File

@ -68,14 +68,14 @@ describe AcademicBenchmark do
"AF2F887A-CCB8-11DD-A7C8-69619DFF4B22" =>
{
short_description: "SS.912.A.1.1",
description: "Describe the importance of historiography, which includes how historical knowledge is obtained" \
" and transmitted, when interpreting events in history."
description: "Describe the importance of historiography, which includes how historical knowledge is obtained " \
"and transmitted, when interpreting events in history."
},
"AF2FEA9A-CCB8-11DD-A7C8-69619DFF4B22" =>
{
short_description: "SS.912.A.1.2",
description: "Utilize a variety of primary and secondary sources to identify author, historical significance," \
" audience, and authenticity to understand a historical period."
description: "Utilize a variety of primary and secondary sources to identify author, historical significance, " \
"audience, and authenticity to understand a historical period."
},
"AF3058F4-CCB8-11DD-A7C8-69619DFF4B22" =>
{
@ -85,8 +85,8 @@ describe AcademicBenchmark do
"AF30C56E-CCB8-11DD-A7C8-69619DFF4B22" =>
{
short_description: "SS.912.A.1.4",
description: "Analyze how images, symbols, objects, cartoons, graphs, charts, maps, and artwork may be used" \
" to interpret the significance of time periods and events from the past."
description: "Analyze how images, symbols, objects, cartoons, graphs, charts, maps, and artwork may be used " \
"to interpret the significance of time periods and events from the past."
},
"AF31281A-CCB8-11DD-A7C8-69619DFF4B22" =>
{
@ -111,8 +111,8 @@ describe AcademicBenchmark do
"AF359634-CCB8-11DD-A7C8-69619DFF4B22" =>
{
short_description: "SS.912.A.3",
description: "Analyze the transformation of the American economy and the changing social and" \
" political conditions in response to the Industrial Revolution."
description: "Analyze the transformation of the American economy and the changing social and " \
"political conditions in response to the Industrial Revolution."
},
"AF3B2A72-CCB8-11DD-A7C8-69619DFF4B22" =>
{
@ -127,14 +127,14 @@ describe AcademicBenchmark do
"AF4522DE-CCB8-11DD-A7C8-69619DFF4B22" =>
{
short_description: "SS.912.A.6",
description: "Understand the causes and course of World War II, the character of the war at home and abroad," \
" and its reshaping of the United States role in the post-war world."
description: "Understand the causes and course of World War II, the character of the war at home and abroad, " \
"and its reshaping of the United States role in the post-war world."
},
"AF4B6DB0-CCB8-11DD-A7C8-69619DFF4B22" =>
{
short_description: "SS.912.A.7",
description: "Understand the rise and continuing international influence of the United States as a" \
" world leader and the impact of contemporary social and political movements on American life."
description: "Understand the rise and continuing international influence of the United States as a " \
"world leader and the impact of contemporary social and political movements on American life."
}
}.each do |migration_id, descriptions|
g = LearningOutcome.global.find_by(migration_id: migration_id)

View File

@ -21,10 +21,10 @@ module RuboCop
module Cop
module Lint
class NoFileUtilsRmRf < Cop
MSG = "In order to enable spec parallelization, avoid FileUtils.rm_rf"\
" and making persistent files/directories. Instead use"\
" Dir.mktmpdir. See https://gerrit.instructure.com/#/c/73834"\
" for the pattern you should follow."
MSG = "In order to enable spec parallelization, avoid FileUtils.rm_rf " \
"and making persistent files/directories. Instead use " \
"Dir.mktmpdir. See https://gerrit.instructure.com/#/c/73834 " \
"for the pattern you should follow."
METHOD = :rm_rf
RECEIVER = :FileUtils

View File

@ -24,10 +24,10 @@ module RuboCop
include RuboCop::Cop::FileMeta
CONTROLLER_MSG = "Avoid using sleep, as it will tie up this process."
SPEC_MSG = "Avoid using sleep. Depending on what you are trying to do,"\
" you should instead consider: Timecop,"\
" vanilla `f` calls (since they wait),"\
" the `become` matcher, `wait_for_ajaximations`, or `keep_trying_until`."
SPEC_MSG = "Avoid using sleep. Depending on what you are trying to do, " \
"you should instead consider: Timecop, " \
"vanilla `f` calls (since they wait), " \
"the `become` matcher, `wait_for_ajaximations`, or `keep_trying_until`."
OTHER_MSG = "Avoid using sleep."
METHOD = :sleep

View File

@ -23,9 +23,9 @@ module RuboCop
class Delay < Cop
include RuboCop::Canvas::MigrationTags
PREDEPLOY_MSG = "`delay` cannot be used in a"\
" predeploy migration, since job servers won't"\
" have the new code yet"
PREDEPLOY_MSG = "`delay` cannot be used in a " \
"predeploy migration, since job servers won't " \
"have the new code yet"
def on_send(node)
super

View File

@ -26,8 +26,8 @@ module RuboCop
class EnsureSpecExtension < Cop
include RuboCop::Cop::FileMeta
MSG = "Spec files need to end with \"_spec.rb\""\
" for rspec to find and run them."
MSG = "Spec files need to end with \"_spec.rb\" " \
"for rspec to find and run them."
METHODS = [:context, :describe].freeze

View File

@ -21,8 +21,8 @@ module RuboCop
module Cop
module Specs
class NoBeforeOnceStubs < Cop
MSG = "Stubs in a `before(:once)` block won't carry over"\
" to the examples; you should move this to a `before(:each)`"
MSG = "Stubs in a `before(:once)` block won't carry over " \
"to the examples; you should move this to a `before(:each)`"
# http://gofreerange.com/mocha/docs/Mocha/Mock.html
# - stubs

View File

@ -22,8 +22,8 @@ module RuboCop
module Specs
class NoDisableImplicitWait < Cop
MSG = "Avoid using disable_implicit_wait.\n" \
"Look through custom_selenium_rspec_matchers.rb" \
" and custom_wait_methods.rb."
"Look through custom_selenium_rspec_matchers.rb " \
"and custom_wait_methods.rb."
METHOD = :disable_implicit_wait

View File

@ -21,10 +21,10 @@ module RuboCop
module Cop
module Specs
class NoExecuteScript < Cop
MSG = "Avoid using execute_script. Instead, perform actual"\
" user interactions such as click/keypress. If these"\
" seem insufficient, consider converting your"\
" integration spec into a JavaScript unit test."
MSG = "Avoid using execute_script. Instead, perform actual " \
"user interactions such as click/keypress. If these " \
"seem insufficient, consider converting your " \
"integration spec into a JavaScript unit test."
METHOD = :execute_script

View File

@ -22,12 +22,12 @@ module RuboCop
module Specs
class NoNoSuchElementError < Cop
MSG = "Avoid using Selenium::WebDriver::Error::NoSuchElementError.\n" \
"Our finders (f/fj and ff/ffj) will wait up to the implicit wait" \
" (just like find_element, etc), and will raise a" \
" Selenium::WebDriver::Error::NoSuchElementError" \
" (just like find_element, etc).\n" \
"Look through custom_selenium_rspec_matchers.rb, particularly" \
" contain_css and contain_jqcss."
"Our finders (f/fj and ff/ffj) will wait up to the implicit wait " \
"(just like find_element, etc), and will raise a " \
"Selenium::WebDriver::Error::NoSuchElementError " \
"(just like find_element, etc).\n" \
"Look through custom_selenium_rspec_matchers.rb, particularly " \
"contain_css and contain_jqcss."
BAD_CONST = "Selenium::WebDriver::Error::NoSuchElementError"
BAD_CONST_MATCHER = BAD_CONST.split("::")

View File

@ -22,12 +22,12 @@ module RuboCop
module Specs
class NoSeleniumWebDriverWait < Cop
MSG = "Avoid using Selenium::WebDriver::Wait.\n" \
"Our finders (f/fj and ff/ffj) will wait up to the implicit wait" \
" (just like find_element, etc), and will raise a" \
" Selenium::WebDriver::Error::NoSuchElementError" \
" (just like find_element, etc).\n" \
"Look through custom_selenium_rspec_matchers.rb" \
" and custom_wait_methods.rb."
"Our finders (f/fj and ff/ffj) will wait up to the implicit wait " \
"(just like find_element, etc), and will raise a " \
"Selenium::WebDriver::Error::NoSuchElementError " \
"(just like find_element, etc).\n" \
"Look through custom_selenium_rspec_matchers.rb " \
"and custom_wait_methods.rb."
BAD_CONST = "Selenium::WebDriver::Wait"
BAD_CONST_MATCHER = BAD_CONST.split("::")

View File

@ -23,8 +23,8 @@ module RuboCop
module Cop
module Specs
class NoSkipWithoutTicket < Cop
MSG = "Reference a ticket if skipping."\
" Example: skip('time bomb on saturdays CNVS-123456')."
MSG = "Reference a ticket if skipping. " \
"Example: skip('time bomb on saturdays CNVS-123456')."
METHOD = :skip

View File

@ -22,8 +22,8 @@ module RuboCop
module Specs
class NoStrftime < Cop
# include RuboCop::Cop::FileMeta
MSG = "Avoid using strftime." \
" Use format_date_for_view or format_time_for_view instead."
MSG = "Avoid using strftime. " \
"Use format_date_for_view or format_time_for_view instead."
METHOD = :strftime

View File

@ -21,8 +21,8 @@ module RuboCop
module Cop
module Specs
class NoWaitForNoSuchElement < Cop
MSG = "Avoid using wait_for_no_such_element. Instead, use"\
" not_to contain_css/contain_link.\n"\
MSG = "Avoid using wait_for_no_such_element. Instead, use " \
"not_to contain_css/contain_link.\n" \
"e.g. expect(f('#courses')).not_to contain_css('#course_123')"
METHOD = :wait_for_no_such_element

View File

@ -47,9 +47,9 @@ module RuboCop
def error_msg(method)
alternative = SUSPECT_METHOD_NAMES[method]
"Prefer `#{alternative}` instead of `#{method}`; `#{method}`"\
" should only be used if you are doing jquery-fake-css selectors"\
" (e.g. `:visible`)"
"Prefer `#{alternative}` instead of `#{method}`; `#{method}` " \
"should only be used if you are doing jquery-fake-css selectors " \
"(e.g. `:visible`)"
end
def autocorrect(node)

View File

@ -21,9 +21,9 @@ module RuboCop
module Cop
module Specs
class ScopeHelperModules < Cop
MSG = "Define all helper and factory methods within modules"\
" (or `shared_context`). Otherwise they will live on Object"\
" and potentially wreak havoc on other specs."
MSG = "Define all helper and factory methods within modules " \
"(or `shared_context`). Otherwise they will live on Object " \
"and potentially wreak havoc on other specs."
WHITELISTED_BLOCKS = %i[
class_eval

View File

@ -23,9 +23,9 @@ module RuboCop
module Cop
module Specs
class ScopeIncludes < Cop
MSG = "Never `include` a module at the top-level. Otherwise its "\
"methods will be added to `Object` (and thus everything), "\
"causing all sorts of mayhem. Move this inside a `describe`, "\
MSG = "Never `include` a module at the top-level. Otherwise its " \
"methods will be added to `Object` (and thus everything), " \
"causing all sorts of mayhem. Move this inside a `describe`, " \
"`shared_context`, etc."
WHITELISTED_BLOCKS = %i[

View File

@ -20,7 +20,7 @@
module Canvas::OAuth
class InvalidScopeError < RequestError
def initialize(missing_scopes)
super("A requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner. "\
super("A requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner. " \
"The following scopes were requested, but not granted: #{missing_scopes.to_sentence(locale: :en)}")
end

View File

@ -78,7 +78,7 @@ module DataFixup::MoveFeatureFlagsToSettings
when "off"
override_value = false
else
Rails.logger.warn("DataFixup::MoveFeatureFlagsToSettings => unable to handle override state for context "\
Rails.logger.warn("DataFixup::MoveFeatureFlagsToSettings => unable to handle override state for context " \
"#{context.asset_string} of feature #{override.id} with state #{override.state}")
end
end

View File

@ -84,7 +84,7 @@ module FeatureFlags
def self.k6_theme_hook(_user, _context, _from_state, transitions)
transitions["on"] ||= {}
transitions["on"]["message"] =
I18n.t("Enabling the Elementary Theme will change the font in the Canvas interface and simplify "\
I18n.t("Enabling the Elementary Theme will change the font in the Canvas interface and simplify " \
"the Course Navigation Menu for all users in your course.")
transitions["on"]["reload_page"] = true
transitions["off"] ||= {}

View File

@ -69,7 +69,7 @@ module Lti
bookmark = pager.current_bookmark
comparison = (pager.include_bookmark ? ">=" : ">")
scope = scope.where(
" (#{name_collation_key} = #{placeholder_collation_key} AND #{id_field} #{comparison} ?) "\
" (#{name_collation_key} = #{placeholder_collation_key} AND #{id_field} #{comparison} ?) " \
"OR #{name_collation_key} #{comparison} #{placeholder_collation_key}",
bookmark[2], bookmark[1], bookmark[2]
)

View File

@ -38,7 +38,7 @@ module Services
def create_tool_proxy_subscription(tool_proxy, subscription)
Rails.logger.info do
"in: LiveEventsSubscriptionService::create_tool_proxy_subscription, "\
"in: LiveEventsSubscriptionService::create_tool_proxy_subscription, " \
"tool_proxy_id: #{tool_proxy.id}, subscription: #{subscription}"
end
create(tool_proxy_jwt_body(tool_proxy), subscription)
@ -50,7 +50,7 @@ module Services
def destroy_tool_proxy_subscription(tool_proxy, subscription_id)
Rails.logger.info do
"in: LiveEventsSubscriptionService::destroy_tool_proxy_subscription, "\
"in: LiveEventsSubscriptionService::destroy_tool_proxy_subscription, " \
"tool_proxy_id: #{tool_proxy.id}, subscription_id: #{subscription_id}"
end
destroy(tool_proxy_jwt_body(tool_proxy), subscription_id)

View File

@ -176,9 +176,9 @@ module Services
def failure_email
display_name = @attachment.display_name
assignment_name = @progress.context.name
body = "Your file, #{display_name}, failed to upload to your "\
"Canvas assignment, #{assignment_name}. Please re-submit to "\
"the assignment or contact your instructor if you are no "\
body = "Your file, #{display_name}, failed to upload to your " \
"Canvas assignment, #{assignment_name}. Please re-submit to " \
"the assignment or contact your instructor if you are no " \
"longer able to do so."
message = OpenStruct.new(

View File

@ -270,14 +270,14 @@ module SIS
def fail_with_error!(e, csv: nil)
return @batch if @batch.workflow_state == "aborted"
message = "Importing CSV for account: "\
message = "Importing CSV for account: " \
"#{@root_account.id} (#{@root_account.name}) sis_batch_id: #{@batch.id}: #{e}"
err_id = Canvas::Errors.capture(e, {
type: :sis_import,
message: message,
during_tests: false
})[:error_report]
error_message = I18n.t("Error while importing CSV. Please contact support. "\
error_message = I18n.t("Error while importing CSV. Please contact support. " \
"(Error report %{number})", number: err_id.to_s)
@batch.shard.activate do
SisBatch.add_error(csv, error_message, sis_batch: @batch, failure: true, backtrace: e.try(:backtrace))

View File

@ -544,8 +544,8 @@ module SIS
def generate_readable_error_message(options)
response = ERRORS_TO_REASONS.fetch(options[:message]) { DEFAULT_REASON }
reason = format(response, options)
"Could not save the user with user_id: '#{options[:user_id]}'." \
" #{reason}"
"Could not save the user with user_id: '#{options[:user_id]}'. " \
"#{reason}"
end
end
end

View File

@ -44,7 +44,7 @@ module Lti
end
it "does not include restricted services" do
restricted_service = "http://www.example.com/api/lti/accounts/#{account.id}/tool_consumer_profile/"\
restricted_service = "http://www.example.com/api/lti/accounts/#{account.id}/tool_consumer_profile/" \
"339b6700-e4cb-47c5-a54f-3ee0064921a9#vnd.Canvas.OriginalityReport"
tool_consumer_profile_id = "a_made_up_id"
get "/api/lti/accounts/#{account.id}/tool_consumer_profile/#{tool_consumer_profile_id}",

View File

@ -94,7 +94,7 @@ describe "Module Items API", type: :request do
quiz.publish!
module_with_page.add_item(id: quiz.id, type: "quiz")
json = api_call(
:get, "/api/v1/courses/#{@course.id}/"\
:get, "/api/v1/courses/#{@course.id}/" \
"module_item_sequence?asset_type=Assignment&asset_id=#{assignment.id}",
controller: "context_module_items_api",
action: "item_sequence",
@ -1353,7 +1353,7 @@ describe "Module Items API", type: :request do
quiz.publish!
quiz_tag = module_with_page.add_item(id: quiz.id, type: "quiz")
json = api_call(
:get, "/api/v1/courses/#{@course.id}/"\
:get, "/api/v1/courses/#{@course.id}/" \
"module_item_sequence?asset_type=Assignment&asset_id=#{assignment.id}",
controller: "context_module_items_api",
action: "item_sequence",
@ -1379,7 +1379,7 @@ describe "Module Items API", type: :request do
quiz.publish!
quiz_tag = module_with_page.add_item(id: quiz.id, type: "quiz")
json = api_call(
:get, "/api/v1/courses/#{@course.id}/"\
:get, "/api/v1/courses/#{@course.id}/" \
"module_item_sequence?asset_type=Assignment&asset_id=#{assignment.id}",
controller: "context_module_items_api",
action: "item_sequence",
@ -1412,7 +1412,7 @@ describe "Module Items API", type: :request do
quiz.publish!
module_with_page.add_item(id: quiz.id, type: "quiz")
json = api_call(
:get, "/api/v1/courses/#{@course.id}/"\
:get, "/api/v1/courses/#{@course.id}/" \
"module_item_sequence?asset_type=Assignment&asset_id=#{assignment.id}",
controller: "context_module_items_api",
action: "item_sequence",

View File

@ -172,9 +172,9 @@ describe QuizzesNext::QuizzesApiController, type: :request do
subject
link_header = response.headers["Link"]
expect(link_header).to eq(
"<http://www.example.com/api/v1/courses/#{@course.id}/all_quizzes?page=1&per_page=2>; rel=\"current\","\
"<http://www.example.com/api/v1/courses/#{@course.id}/all_quizzes?page=2&per_page=2>; rel=\"next\","\
"<http://www.example.com/api/v1/courses/#{@course.id}/all_quizzes?page=1&per_page=2>; rel=\"first\","\
"<http://www.example.com/api/v1/courses/#{@course.id}/all_quizzes?page=1&per_page=2>; rel=\"current\"," \
"<http://www.example.com/api/v1/courses/#{@course.id}/all_quizzes?page=2&per_page=2>; rel=\"next\"," \
"<http://www.example.com/api/v1/courses/#{@course.id}/all_quizzes?page=1&per_page=2>; rel=\"first\"," \
"<http://www.example.com/api/v1/courses/#{@course.id}/all_quizzes?page=4&per_page=2>; rel=\"last\""
)
end

View File

@ -32,7 +32,6 @@ module Factories
end
def valid_rubric_assessment_attributes
{
}
{}
end
end

View File

@ -30,7 +30,6 @@ module Factories
end
def valid_rubric_assessment_attributes
{
}
{}
end
end

View File

@ -335,29 +335,29 @@ describe Outcomes::LearningOutcomeGroupChildren do
context: context,
outcome_group: g1,
title: "LA.1.1.1",
description: "continue to apply phonic knowledge and skills as the route to decode words until "\
description: "continue to apply phonic knowledge and skills as the route to decode words until " \
"automatic decoding has become embedded and reading is fluent"
)
outcome_model(
context: context,
outcome_group: g1,
title: "LA.2.2.1.2",
description: "Explain anticipated meaning, recognize relationships, and draw conclusions; self-correct"\
" understanding using a variety of strategies [including rereading for story sense]."
description: "Explain anticipated meaning, recognize relationships, and draw conclusions; self-correct " \
"understanding using a variety of strategies [including rereading for story sense]."
)
outcome_model(
context: context,
outcome_group: g1,
title: "FO.3",
description: "apply their growing knowledge of root words, prefixes and suffixes (etymology and morphology)"\
" as listed in English Appendix 1, both to read aloud and to understand the meaning of new wor"\
description: "apply their growing knowledge of root words, prefixes and suffixes (etymology and morphology) " \
"as listed in English Appendix 1, both to read aloud and to understand the meaning of new wor" \
"ds they meet"
)
outcome_model(
context: context,
outcome_group: g1,
title: "HT.ML.1.1",
description: "<p>Pellentesque&nbsp;habitant morbi tristique senectus et netus et malesuada fames ac turpis e"\
description: "<p>Pellentesque&nbsp;habitant morbi tristique senectus et netus et malesuada fames ac turpis e" \
"gestas.</p>"
)
outcome_model(

View File

@ -40,9 +40,9 @@ module Services
from_name: "notifications@instructure.com",
subject: "Submission upload failed: #{assignment.name}",
to: user.email,
body: "Your file, #{attachment.display_name}, failed to upload to your "\
"Canvas assignment, #{assignment.name}. Please re-submit to "\
"the assignment or contact your instructor if you are no "\
body: "Your file, #{attachment.display_name}, failed to upload to your " \
"Canvas assignment, #{assignment.name}. Please re-submit to " \
"the assignment or contact your instructor if you are no " \
"longer able to do so."
)
end

View File

@ -37,8 +37,7 @@ describe SIS::CSV::DiffGenerator do
describe "#generate_csvs" do
it "skips diffing if previous is empty" do
previous = {
}
previous = {}
current = {
course: [{ file: "courses2.csv" }],

View File

@ -185,7 +185,7 @@ describe ContextExternalTool do
it { is_expected.to match_array [no_permission_required_tool, permission_required_tool] }
end
context "when the current user does not have the required permission" do\
context "when the current user does not have the required permission" do \
it { is_expected.to match_array [no_permission_required_tool] }
end
end

View File

@ -102,7 +102,7 @@ describe ErrorReport do
report.assign_data(Canvas::Errors::Info.useful_http_env_stuff_from_request(req))
expect(report.data["QUERY_STRING"]).to eq "?access_token=[FILTERED]&pseudonym[password]=[FILTERED]"
expected_uri = "https://www.instructure.example.com?"\
expected_uri = "https://www.instructure.example.com?" \
"access_token=[FILTERED]&pseudonym[password]=[FILTERED]"
expect(report.data["REQUEST_URI"]).to eq(expected_uri)
expect(report.data["path_parameters"]).to eq({ api_key: "[FILTERED]" }.inspect)

View File

@ -250,8 +250,8 @@ describe OriginalityReport do
it "creates an LTI launch URL if a lti_link is present" do
report.update(lti_link: lti_link)
expected_url = "/courses/"\
"#{submission.assignment.course.id}/assignments/"\
expected_url = "/courses/" \
"#{submission.assignment.course.id}/assignments/" \
"#{submission.assignment.id}/lti/resource/#{lti_link.resource_link_id}?display=borderless"
expect(report.report_launch_path).to eq expected_url
end

View File

@ -517,8 +517,8 @@ describe Submission do
}.from(20.minutes.ago(@now)).to(15.minutes.ago(@now))
end
it "changes if an individual override is added for the student, even when the due date is earlier" \
" than an existing override that applies to the student for the assignment" do
it "changes if an individual override is added for the student, even when the due date is earlier " \
"than an existing override that applies to the student for the assignment" do
section = @course.course_sections.create!(name: "My Awesome Section")
student_in_section(section, user: @student)
@assignment.assignment_overrides.create!(
@ -537,8 +537,8 @@ describe Submission do
}.from(10.minutes.ago(@now)).to(15.minutes.ago(@now))
end
it "does not change if a non-individual-override is added for the student and the due date" \
" is earlier than an existing override that applies to the student for the assignment" do
it "does not change if a non-individual-override is added for the student and the due date " \
"is earlier than an existing override that applies to the student for the assignment" do
category = @course.group_categories.create!(name: "New Group Category")
group = @course.groups.create!(group_category: category)
group.add_user(@student, "active")
@ -848,8 +848,8 @@ describe Submission do
end
end
it "returns seconds_late_override if the submission has a late_policy_status of 'late'" \
" and a seconds_late_override" do
it "returns seconds_late_override if the submission has a late_policy_status of 'late' " \
"and a seconds_late_override" do
Timecop.freeze(@date) do
@assignment.submit_homework(@student, body: "a body")
submission.update!(late_policy_status: "late", seconds_late_override: 90.minutes)
@ -857,8 +857,8 @@ describe Submission do
end
end
it "is not adjusted if the student resubmits and the submission has a late_policy_status of 'late'" \
" and a seconds_late_override" do
it "is not adjusted if the student resubmits and the submission has a late_policy_status of 'late' " \
"and a seconds_late_override" do
Timecop.freeze(@date) { @assignment.submit_homework(@student, body: "a body") }
submission.update!(late_policy_status: "late", seconds_late_override: 90.minutes)
Timecop.freeze(40.minutes.from_now(@date)) do
@ -882,8 +882,8 @@ describe Submission do
end
end
it "is zero if it was turned in late but the teacher sets the late_policy_status to 'late'" \
" and sets seconds_late_override to zero" do
it "is zero if it was turned in late but the teacher sets the late_policy_status to 'late' " \
"and sets seconds_late_override to zero" do
Timecop.freeze(@date) do
@assignment.submit_homework(@student, body: "a body")
submission.update!(late_policy_status: "late", seconds_late_override: 0)

View File

@ -52,7 +52,7 @@ shared_examples_for "k5 subject navigation tabs" do
get "/courses/#{@subject_course.id}"
tab_list_text = "Math Schedule\nSchedule\nMath Home\nHome\nMath Grades\nGrades\nMath Modules\nModules\n"\
tab_list_text = "Math Schedule\nSchedule\nMath Home\nHome\nMath Grades\nGrades\nMath Modules\nModules\n" \
"Math Resources\nResources"
tab_list_text += "\nMath Groups\nGroups" if @subject_course.user_is_instructor?(@current_user)

View File

@ -63,9 +63,9 @@ describe "discussion assignments" do
it "creates a group discussion ungraded", priority: "1" do
expect_new_page_load { submit_form(".form-actions") }
expect(f("#discussion_container").text).to include("Since this is a group discussion,"\
" each group has its own conversation for this topic."\
" Here are the ones you have access to:\nsome group")
expect(f("#discussion_container").text).to include("Since this is a group discussion, " \
"each group has its own conversation for this topic. " \
"Here are the ones you have access to:\nsome group")
end
it "creates a group discussion graded", priority: "1" do
@ -74,9 +74,9 @@ describe "discussion assignments" do
click_option("#assignment_group_id", "Assignment Group")
expect_new_page_load { submit_form(".form-actions") }
expect(f("#discussion_container").text).to include("This is a graded discussion: 10 points possible")
expect(f("#discussion_container").text).to include("Since this is a group discussion,"\
" each group has its own conversation for this topic."\
" Here are the ones you have access to:\nsome group")
expect(f("#discussion_container").text).to include("Since this is a group discussion, " \
"each group has its own conversation for this topic. " \
"Here are the ones you have access to:\nsome group")
end
end

View File

@ -161,9 +161,9 @@ describe "discussions" do
expect(drop_down).to include("category 1")
click_option("#assignment_group_category_id", @category1.name)
expect_new_page_load { submit_form(".form-actions") }
expect(f("#discussion_container").text).to include("Since this is a group discussion,"\
" each group has its own conversation for this topic."\
" Here are the ones you have access to:\nsome group")
expect(f("#discussion_container").text).to include("Since this is a group discussion, " \
"each group has its own conversation for this topic. " \
"Here are the ones you have access to:\nsome group")
end
it "creates a graded discussion", priority: "1" do
@ -202,9 +202,9 @@ describe "discussions" do
click_option("#assignment_group_category_id", @category1.name)
expect_new_page_load { submit_form(".form-actions") }
expect(f("#discussion_container").text).to include("This is a graded discussion: 10 points possible")
expect(f("#discussion_container").text).to include("Since this is a group discussion,"\
" each group has its own conversation for this topic."\
" Here are the ones you have access to:\nsome group")
expect(f("#discussion_container").text).to include("Since this is a group discussion, " \
"each group has its own conversation for this topic. " \
"Here are the ones you have access to:\nsome group")
expect(f("a.discussion-reply-action[role='button']")).to be_present
end

View File

@ -237,7 +237,7 @@ describe "Excuse an Assignment" do
assignment = @course.assignments.create! title: "Excuse Me", points_possible: 20
if view == "srgb"
skip "Skipped because this spec fails if not run in foreground\n"\
skip "Skipped because this spec fails if not run in foreground\n" \
"This is believed to be the issue: https://code.google.com/p/selenium/issues/detail?id=7346"
get "/courses/#{@course.id}/gradebook/change_gradebook_version?version=srgb"
click_option f("#assignment_select"), assignment.title
@ -276,7 +276,7 @@ describe "Excuse an Assignment" do
total = ""
if view == "srgb"
skip "Skipped because this spec fails if not run in foreground\n"\
skip "Skipped because this spec fails if not run in foreground\n" \
"This is believed to be the issue: https://code.google.com/p/selenium/issues/detail?id=7346"
get "/courses/#{@course.id}/gradebook/change_gradebook_version?version=srgb"
click_option f("#student_select"), @student.name

View File

@ -108,8 +108,8 @@ describe "Speedgrader" do
Speedgrader.visit(@course.id, @quiz.assignment_id)
Speedgrader.wait_for_grade_input
end
Rails.logger.debug "SpeedGrader for course #{@course.id} and assignment"\
" #{@quiz.assignment_id} loaded in #{page_load_time.real} seconds"
Rails.logger.debug "SpeedGrader for course #{@course.id} and assignment " \
"#{@quiz.assignment_id} loaded in #{page_load_time.real} seconds"
expect(page_load_time.real).to be > 0.0
end

View File

@ -198,7 +198,7 @@ describe "Screenreader Gradebook" do
end
it "displays/removes warning message for resubmitted assignments", priority: "1" do
skip "Skipped because this spec fails if not run in foreground\n"\
skip "Skipped because this spec fails if not run in foreground\n" \
"This is believed to be the issue: https://code.google.com/p/selenium/issues/detail?id=7346"
assignment = basic_percent_setup
user_session @students[0]
@ -221,7 +221,7 @@ describe "Screenreader Gradebook" do
end
it "grades match default gradebook grades", priority: "1" do
skip "Skipped because this spec fails if not run in foreground\n"\
skip "Skipped because this spec fails if not run in foreground\n" \
"This is believed to be the issue: https://code.google.com/p/selenium/issues/detail?id=7346"
a1 = basic_percent_setup
a2 = @course.assignments.create!(

View File

@ -98,7 +98,7 @@ describe "Notifications" do
expect(ff(".ic-Table--condensed.grid td")[7]).to include_text("Anonymous User")
fj('.ui-tabs-anchor:contains("Plain Text")').click
expect(f(".message-body")).to include_text("Anonymous User just made a new comment on the "\
expect(f(".message-body")).to include_text("Anonymous User just made a new comment on the " \
"submission for #{@student.reload.short_name} for assignment")
end

View File

@ -69,10 +69,10 @@ describe "outcomes" do
it "validates default values", priority: "1" do
expect(f("#calculation_method")).to have_value("decaying_average")
expect(f("#calculation_int")).to have_value("65")
expect(f("#calculation_int_example")).to include_text("Most recent result counts as 65%"\
" of mastery weight, average of all other results count"\
" as 35% of weight. If there is only one result, the single score"\
" will be returned.")
expect(f("#calculation_int_example")).to include_text("Most recent result counts as 65% " \
"of mastery weight, average of all other results count " \
"as 35% of weight. If there is only one result, the single score " \
"will be returned.")
end
it "validates decaying average_range", priority: "2" do
@ -101,9 +101,9 @@ describe "outcomes" do
click_option("#calculation_method", "n Number of Times")
expect(f("#calculation_int")).to have_value("5")
expect(f("#mastery_points")).to have_value("3")
expect(f("#calculation_int_example")).to include_text("Must achieve mastery at least 5 times."\
" Scores above mastery will be averaged"\
" to calculate final score")
expect(f("#calculation_int_example")).to include_text("Must achieve mastery at least 5 times. " \
"Scores above mastery will be averaged " \
"to calculate final score")
end
it "validates n mastery_range", priority: "2" do

View File

@ -87,7 +87,7 @@ describe "editing a quiz" do
# verify alert
alert_box = f(".alert .unpublished_warning")
expect(alert_box.text)
.to eq "You have made changes to the questions in this quiz.\nThese "\
.to eq "You have made changes to the questions in this quiz.\nThese " \
"changes will not appear for students until you save the quiz."
# verify button

View File

@ -55,8 +55,8 @@ describe "Grading quizzes" do
it "shows the regrade options", priority: "1" do
# verify presence of regrade alert
expect(fj(".ui-dialog:visible .alert")).to include_text "Choose a regrade option" \
" for students who have already taken the quiz"
expect(fj(".ui-dialog:visible .alert")).to include_text "Choose a regrade option " \
"for students who have already taken the quiz"
# verify all regrade options are present
expect(visible_regrade_options.count).to eq 4
@ -88,16 +88,16 @@ describe "Grading quizzes" do
delete_possible_answer(1)
# verify alert message
expect(driver.switch_to.alert.text).to eq "Are you sure? Deleting answers from a question with" \
" submissions disables the option to regrade this question."
expect(driver.switch_to.alert.text).to eq "Are you sure? Deleting answers from a question with " \
"submissions disables the option to regrade this question."
accept_alert
select_different_correct_answer(1)
# verify explanation message
expect(fj(".ui-dialog:visible .regrade_option_text")).to include_text "Regrading is not allowed" \
" on this question because either an answer was removed or the" \
" question type was changed after a student completed a submission."
expect(fj(".ui-dialog:visible .regrade_option_text")).to include_text "Regrading is not allowed " \
"on this question because either an answer was removed or the " \
"question type was changed after a student completed a submission."
expect(f("#content")).not_to contain_jqcss(".regrade_enabled label.checkbox:visible")
end

View File

@ -68,8 +68,8 @@ describe "quiz restrictions as a student" do
it "is not accessible from invalid ip address", priority: "1" do
begin_taking_quiz
expect(f("#content")).to include_text "This quiz is protected and is only available from certain locations."\
" The computer you are currently using does not appear to be at a valid location for taking this quiz."
expect(f("#content")).to include_text "This quiz is protected and is only available from certain locations. " \
"The computer you are currently using does not appear to be at a valid location for taking this quiz."
expect(f("#content")).not_to contain_css("#submit_quiz_form")
end
end

View File

@ -81,7 +81,7 @@ describe "viewing a quiz with variable due dates on the quizzes index page" do
end
it "shows the availability dates for Section B", priority: "2" do
expect(f(".date-available")).to include_text("Not available until "\
expect(f(".date-available")).to include_text("Not available until " \
"#{format_date_for_view(@unlock_at_b, :short)}")
end
end

View File

@ -39,7 +39,7 @@ describe "viewing a quiz with variable due dates on the quizzes index page" do
end
it "shows the availability dates for Section A", priority: "1" do
expect(f(".date-available")).to include_text("Available until "\
expect(f(".date-available")).to include_text("Available until " \
"#{format_date_for_view(@lock_at_a, :short)}")
end
end
@ -57,7 +57,7 @@ describe "viewing a quiz with variable due dates on the quizzes index page" do
end
it "shows the availability dates for Section B", priority: "1" do
expect(f(".date-available")).to include_text("Not available until "\
expect(f(".date-available")).to include_text("Not available until " \
"#{format_date_for_view(@unlock_at_b, :short)}")
end
end

View File

@ -61,7 +61,7 @@ describe "viewing a quiz with variable due dates on the quiz show page" do
end
it "shows the availability dates for Section B", priority: "2" do
validate_quiz_show_page("Available #{format_time_for_view(@unlock_at_b)} "\
validate_quiz_show_page("Available #{format_time_for_view(@unlock_at_b)} " \
"- #{format_time_for_view(@lock_at_b)}")
end

View File

@ -39,7 +39,7 @@ describe "viewing a quiz with variable due dates on the quiz show page" do
end
it "shows the availability dates for Section A", priority: "1" do
validate_quiz_show_page("Available #{format_time_for_view(@unlock_at_a)} "\
validate_quiz_show_page("Available #{format_time_for_view(@unlock_at_a)} " \
"- #{format_time_for_view(@lock_at_a)}")
end
@ -61,7 +61,7 @@ describe "viewing a quiz with variable due dates on the quiz show page" do
end
it "shows its availability dates", priority: "1" do
validate_quiz_show_page("Available #{format_time_for_view(@unlock_at_b)} "\
validate_quiz_show_page("Available #{format_time_for_view(@unlock_at_b)} " \
"- #{format_time_for_view(@lock_at_b)}")
end

View File

@ -51,9 +51,9 @@ describe "discussion assignments" do
it "creates a group discussion ungraded", priority: "1" do
expect_new_page_load { submit_form(".form-actions") }
expect(f("#discussion_container").text).to include("Since this is a group discussion,"\
" each group has its own conversation for this topic."\
" Here are the ones you have access to:\nsome group")
expect(f("#discussion_container").text).to include("Since this is a group discussion, " \
"each group has its own conversation for this topic. " \
"Here are the ones you have access to:\nsome group")
end
it "creates a group discussion graded", priority: "1" do
@ -62,9 +62,9 @@ describe "discussion assignments" do
click_option("#assignment_group_id", "Assignment Group")
expect_new_page_load { submit_form(".form-actions") }
expect(f("#discussion_container").text).to include("This is a graded discussion: 10 points possible")
expect(f("#discussion_container").text).to include("Since this is a group discussion,"\
" each group has its own conversation for this topic."\
" Here are the ones you have access to:\nsome group")
expect(f("#discussion_container").text).to include("Since this is a group discussion, " \
"each group has its own conversation for this topic. " \
"Here are the ones you have access to:\nsome group")
end
end

View File

@ -195,12 +195,12 @@ module CustomSeleniumRSpecMatchers
end
failure_message do |element|
"expected #{element.inspect}'s #{attribute} attribute to have value of #{expected || "not nil"}, "\
"expected #{element.inspect}'s #{attribute} attribute to have value of #{expected || "not nil"}, " \
"actual #{attribute} attribute value: #{element.attribute(attribute.to_s)}"
end
failure_message_when_negated do |element|
"expected #{element.inspect}'s #{attribute} attribute to NOT have value of #{expected || "not nil"}, "\
"expected #{element.inspect}'s #{attribute} attribute to NOT have value of #{expected || "not nil"}, " \
"actual #{attribute} attribute type: #{element.attribute(attribute.to_s)}"
end
end

View File

@ -539,8 +539,8 @@ describe "accounts/settings" do
def expect_threshold_to_be(value)
expect(response).to have_tag(
"select#account_settings_smart_alerts_threshold" \
" option[value=\"#{value}\"][selected]"
"select#account_settings_smart_alerts_threshold " \
"option[value=\"#{value}\"][selected]"
)
end