mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
25 lines
865 B
Ruby
25 lines
865 B
Ruby
|
# 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
|