1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actiontext/test/integration/controller_render_test.rb

25 lines
865 B
Ruby
Raw Normal View History

# frozen_string_literal: true
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")
message = Message.create!(content: ActionText::Content.new.append_attachables(blob))
host! "loocalhoost"
get message_path(message)
assert_select "#content img" do |imgs|
imgs.each { |img| assert_match %r"//loocalhoost/", img["src"] }
end
end
test "resolves partials when controller is namespaced" do
blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpg")
message = Message.create!(content: ActionText::Content.new.append_attachables(blob))
get admin_message_path(message)
assert_select "#content-html .trix-content .attachment--jpg"
end
end