From 3dcf6425d8ff547e7030fa2307b8087f58a9a77e Mon Sep 17 00:00:00 2001 From: Aaron Ogata Date: Mon, 28 Nov 2022 08:32:47 -0800 Subject: [PATCH] use nicer language in specs Change-Id: I7ab827d040de38726800e252ee24482769c3e42d Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/306139 Tested-by: Service Cloud Jenkins Reviewed-by: Andrea Cirulli Reviewed-by: Michael Hargiss QA-Review: Aaron Ogata Product-Review: Aaron Ogata --- spec/apis/v1/discussion_topics_api_spec.rb | 6 +++--- spec/apis/v1/submissions_api_spec.rb | 12 ++++++------ spec/controllers/accounts_controller_spec.rb | 2 +- spec/factories/attachment_factory.rb | 4 ++-- spec/graphql/types/file_type_spec.rb | 2 +- spec/lib/canvas/live_events_spec.rb | 4 ++-- spec/lib/lti/content_item_response_spec.rb | 4 ++-- spec/models/attachment_spec.rb | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/spec/apis/v1/discussion_topics_api_spec.rb b/spec/apis/v1/discussion_topics_api_spec.rb index 5c927f9149f..50aae864784 100644 --- a/spec/apis/v1/discussion_topics_api_spec.rb +++ b/spec/apis/v1/discussion_topics_api_spec.rb @@ -2919,10 +2919,10 @@ describe DiscussionTopicsController, type: :request do ].sort_by { |h| h["id"] }) reply_reply1_attachment_json = { - "content-type" => "application/loser", + "content-type" => "application/unknown", "url" => "http://www.example.com/files/#{@attachment.id}/download?download_frd=1&verifier=#{@attachment.uuid}", - "filename" => "unknown.loser", - "display_name" => "unknown.loser", + "filename" => "unknown.example", + "display_name" => "unknown.example", "id" => @attachment.id, "uuid" => @attachment.uuid, "folder_id" => @attachment.folder_id, diff --git a/spec/apis/v1/submissions_api_spec.rb b/spec/apis/v1/submissions_api_spec.rb index 4ca14b4e9e9..59b30f3b80b 100644 --- a/spec/apis/v1/submissions_api_spec.rb +++ b/spec/apis/v1/submissions_api_spec.rb @@ -1193,10 +1193,10 @@ describe "Submissions API", type: :request do "extra_attempts" => nil, "attachments" => [ - { "content-type" => "application/loser", + { "content-type" => "application/unknown", "url" => "http://www.example.com/files/#{sub1.attachments.first.id}/download?download_frd=1&verifier=#{sub1.attachments.first.uuid}", - "filename" => "unknown.loser", - "display_name" => "unknown.loser", + "filename" => "unknown.example", + "display_name" => "unknown.example", "upload_status" => "success", "id" => sub1.attachments.first.id, "uuid" => sub1.attachments.first.uuid, @@ -1296,10 +1296,10 @@ describe "Submissions API", type: :request do "display_name" => nil }, "attachments" => [ - { "content-type" => "application/loser", + { "content-type" => "application/unknown", "url" => "http://www.example.com/files/#{sub1.attachments.first.id}/download?download_frd=1&verifier=#{sub1.attachments.first.uuid}", - "filename" => "unknown.loser", - "display_name" => "unknown.loser", + "filename" => "unknown.example", + "display_name" => "unknown.example", "upload_status" => "success", "id" => sub1.attachments.first.id, "uuid" => sub1.attachments.first.uuid, diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb index 0374d147129..cf3a9398ec3 100644 --- a/spec/controllers/accounts_controller_spec.rb +++ b/spec/controllers/accounts_controller_spec.rb @@ -734,7 +734,7 @@ describe AccountsController do context "without :manage_storage_quotas" do before :once do - role = custom_account_role "quota-loser", account: @account + role = custom_account_role "quota-example", account: @account @account.role_overrides.create! permission: "manage_account_settings", enabled: true, role: role @account.account_users.create!(user: @user, role: role) diff --git a/spec/factories/attachment_factory.rb b/spec/factories/attachment_factory.rb index c13f881046f..e0c90153719 100644 --- a/spec/factories/attachment_factory.rb +++ b/spec/factories/attachment_factory.rb @@ -66,8 +66,8 @@ module Factories context: @context, size: 100, folder: folder, - content_type: "application/loser", - filename: "unknown.loser" + content_type: "application/unknown", + filename: "unknown.example" } end diff --git a/spec/graphql/types/file_type_spec.rb b/spec/graphql/types/file_type_spec.rb index 5186d6d4d29..22f795ce03a 100644 --- a/spec/graphql/types/file_type_spec.rb +++ b/spec/graphql/types/file_type_spec.rb @@ -121,7 +121,7 @@ describe Types::FileType do it "returns nil if the file is not a canvadocable type" do allow(Canvadocs).to receive(:enabled?).and_return true - @student_file.update!(content_type: "application/loser") + @student_file.update!(content_type: "application/unknown") expect( @resolver.resolve('submissionPreviewUrl(submissionId: "' + @submission.id.to_s + '")') ).to be_nil diff --git a/spec/lib/canvas/live_events_spec.rb b/spec/lib/canvas/live_events_spec.rb index 5a62f5c0679..cf6ca405e19 100644 --- a/spec/lib/canvas/live_events_spec.rb +++ b/spec/lib/canvas/live_events_spec.rb @@ -780,7 +780,7 @@ describe Canvas::LiveEvents do attachment_model expect_event("asset_accessed", { - asset_name: "unknown.loser", + asset_name: "unknown.example", asset_type: "attachment", asset_id: @attachment.global_id.to_s, asset_subtype: nil, @@ -799,7 +799,7 @@ describe Canvas::LiveEvents do context = OpenStruct.new(global_id: "1") expect_event("asset_accessed", { - asset_name: "unknown.loser", + asset_name: "unknown.example", asset_type: "attachment", asset_id: @attachment.global_id.to_s, asset_subtype: nil, diff --git a/spec/lib/lti/content_item_response_spec.rb b/spec/lib/lti/content_item_response_spec.rb index c446644cdee..0b9ad487a1d 100644 --- a/spec/lib/lti/content_item_response_spec.rb +++ b/spec/lib/lti/content_item_response_spec.rb @@ -135,7 +135,7 @@ describe Lti::ContentItemResponse do it "gets the title for a file" do file = attachment_model(context: context) content_item_response = subject({ files: [file.id] }) - expect(content_item_response.title).to eq "unknown.loser" + expect(content_item_response.title).to eq "unknown.example" end it "gets the title for a assignment" do @@ -188,7 +188,7 @@ describe Lti::ContentItemResponse do it "gets the files content_type" do file = attachment_model(context: context) content_item_response = subject({ files: [file.id] }) - expect(content_item_response.content_type).to eq "application/loser" + expect(content_item_response.content_type).to eq "application/unknown" end it "gets the content_type for non files" do diff --git a/spec/models/attachment_spec.rb b/spec/models/attachment_spec.rb index b7847402f90..63c2e646f18 100644 --- a/spec/models/attachment_spec.rb +++ b/spec/models/attachment_spec.rb @@ -1762,7 +1762,7 @@ describe Attachment do before do s3_storage! Attachment.current_root_account = @old_account - @root = attachment_model(filename: "unknown 2.loser") + @root = attachment_model(filename: "unknown 2.example") @child = attachment_model(root_attachment: @root) @old_object = double("old object")