mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-09 16:20:09 +09:00
Reuse token-free message controls and render posting deliveries once
This commit is contained in:
@@ -49,8 +49,12 @@ class MessagesControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "creating a message broadcasts the message to the room" do
|
||||
ContentFilters::TextMessagePresentationFilters.expects(:apply).once.with { |body| body.to_plain_text == "New one" }.returns(ActionText::Content.new("New one"))
|
||||
post room_messages_url(@room, format: :turbo_stream), params: { message: { body: "New one", client_message_id: 999 } }
|
||||
|
||||
assert_response :success
|
||||
assert_select "turbo-stream[action=append] .message__body", text: /New one/
|
||||
|
||||
assert_rendered_turbo_stream_broadcast @room, :messages, action: "append", target: [ @room, :messages ] do
|
||||
assert_select ".message__body", text: /New one/
|
||||
assert_copy_link_button room_at_message_url(@room, Message.last, host: "once.campfire.test")
|
||||
|
||||
Reference in New Issue
Block a user