2021-06-29 09:02:57 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe MessageFormatHelper, type: :helper do
|
|
|
|
describe '#transform_user_mention_content' do
|
|
|
|
context 'when transform_user_mention_content called' do
|
|
|
|
it 'return transormed text correctly' do
|
|
|
|
expect(helper.transform_user_mention_content('[@john](mention://user/1/John%20K), check this ticket')).to eq '@john, check this ticket'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2021-12-09 06:20:28 +00:00
|
|
|
|
|
|
|
describe '#render_message_content' do
|
|
|
|
context 'when render_message_content called' do
|
|
|
|
it 'render text correctly' do
|
|
|
|
expect(helper.render_message_content('Hi *there*, I am mostly text!')).to eq "<p>Hi <em>there</em>, I am mostly text!</p>\n"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2021-06-29 09:02:57 +00:00
|
|
|
end
|