From 07f43ec07f608223a09099e7813c7fd7f2c3ae25 Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Mon, 27 Sep 2021 16:57:34 +0200 Subject: [PATCH] add test for link_to_url --- test/unit/helpers/global_helper_test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/unit/helpers/global_helper_test.rb b/test/unit/helpers/global_helper_test.rb index 9cdbb38e..a5e064f0 100644 --- a/test/unit/helpers/global_helper_test.rb +++ b/test/unit/helpers/global_helper_test.rb @@ -47,4 +47,9 @@ class GlobalHelperTest < ActionView::TestCase html = font_awesome_icon 'fas_cloud-upload-alt', post_text: 'Testing' assert_include ' Testing', html end + + def test_link_to_url + assert_equal 'redmine.org/test', Nokogiri::HTML.parse(link_to_url('http://redmine.org/test')).xpath('//a').first.text + assert_equal 'redmine.org/test', Nokogiri::HTML.parse(link_to_url('https://redmine.org/test')).xpath('//a').first.text + end end