From e9e2fd6f9f4033ca67ddb65c32fd658fefcbbd92 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sat, 19 Mar 2022 07:20:31 +0000 Subject: [PATCH] Fix deprecation warnings in Action Text tests Support for the image/jpg content type will be removed in Rails 7.1 and the use of it within the Action Text tests appears to be a typo. --- actiontext/test/integration/controller_render_test.rb | 6 +++--- actiontext/test/integration/mailer_render_test.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actiontext/test/integration/controller_render_test.rb b/actiontext/test/integration/controller_render_test.rb index de50b769b7d..0f1a47fd8da 100644 --- a/actiontext/test/integration/controller_render_test.rb +++ b/actiontext/test/integration/controller_render_test.rb @@ -4,7 +4,7 @@ require "test_helper" class ActionText::ControllerRenderTest < ActionDispatch::IntegrationTest test "uses current request environment" do - blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpg") + blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpeg") message = Message.create!(content: ActionText::Content.new.append_attachables(blob)) host! "loocalhoost" @@ -15,7 +15,7 @@ class ActionText::ControllerRenderTest < ActionDispatch::IntegrationTest end test "renders as HTML when the request format is not HTML" do - blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpg") + blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpeg") message = Message.create!(content: ActionText::Content.new.append_attachables(blob)) host! "loocalhoost" @@ -34,7 +34,7 @@ class ActionText::ControllerRenderTest < ActionDispatch::IntegrationTest end test "resolves partials when controller is namespaced" do - blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpg") + blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpeg") message = Message.create!(content: ActionText::Content.new.append_attachables(blob)) get admin_message_path(message) diff --git a/actiontext/test/integration/mailer_render_test.rb b/actiontext/test/integration/mailer_render_test.rb index e7873794450..620eac01106 100644 --- a/actiontext/test/integration/mailer_render_test.rb +++ b/actiontext/test/integration/mailer_render_test.rb @@ -7,7 +7,7 @@ class ActionText::MailerRenderTest < ActionMailer::TestCase original_default_url_options = ActionMailer::Base.default_url_options ActionMailer::Base.default_url_options = { host: "hoost" } - blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpg") + blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpeg") message = Message.new(content: ActionText::Content.new.append_attachables(blob)) MessagesMailer.with(recipient: "test", message: message).notification.deliver_now