From 6e8df4ce22d3c2d28079cd4b786f255a265f80ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Mon, 23 Feb 2026 08:38:28 +0100 Subject: [PATCH] Revert specs changed for external redirect behavior again when not active --- spec/features/a11y/external_links_spec.rb | 3 +-- spec/features/external_link_capture_spec.rb | 3 +-- .../overview_page/dialog/inputs_spec.rb | 3 +-- spec/features/wiki/wiki_page_external_link_spec.rb | 3 +-- .../details/custom_fields/custom_field_spec.rb | 7 +++---- .../work_packages/details/markdown/todolist_spec.rb | 6 ++---- spec/features/wysiwyg/linking_spec.rb | 4 ++-- 7 files changed, 11 insertions(+), 18 deletions(-) diff --git a/spec/features/a11y/external_links_spec.rb b/spec/features/a11y/external_links_spec.rb index 997892d7530..bb3be11fc57 100644 --- a/spec/features/a11y/external_links_spec.rb +++ b/spec/features/a11y/external_links_spec.rb @@ -54,8 +54,7 @@ RSpec.describe "External links", :js do document.body.appendChild(link); JS - href = external_redirect_path(url: "https://example.com/") - link = page.find_link("External Example", href:, match: :first) + link = page.find_link("External Example", href: "https://example.com", match: :first) # Verify accessibility and security attributes expect(link[:target]).to eq("_blank") diff --git a/spec/features/external_link_capture_spec.rb b/spec/features/external_link_capture_spec.rb index 2ef6c02cdde..185a88f43d4 100644 --- a/spec/features/external_link_capture_spec.rb +++ b/spec/features/external_link_capture_spec.rb @@ -51,8 +51,7 @@ RSpec.describe "External link capture", :js, :selenium do it "keeps the default external link behaviour" do visit project_wiki_path(project, wiki_page) - href = external_redirect_path(url: external_url) - link = page.find_link("OpenProject", href:) + link = page.find_link("OpenProject", href: external_url) new_window = window_opened_by { link.click } within_window new_window do diff --git a/spec/features/projects/project_custom_fields/overview_page/dialog/inputs_spec.rb b/spec/features/projects/project_custom_fields/overview_page/dialog/inputs_spec.rb index 62e18063836..3b51779c5fb 100644 --- a/spec/features/projects/project_custom_fields/overview_page/dialog/inputs_spec.rb +++ b/spec/features/projects/project_custom_fields/overview_page/dialog/inputs_spec.rb @@ -203,8 +203,7 @@ RSpec.describe "Edit project custom fields on project overview page", :js do it "renders the custom field as a link" do page.within_test_selector "project-custom-field-#{link_project_custom_field.id}" do - href = external_redirect_path(url: "https://www.openproject.org/") - expect(page).to have_link("https://www.openproject.org", href:) + expect(page).to have_link("https://www.openproject.org", href: "https://www.openproject.org") end end end diff --git a/spec/features/wiki/wiki_page_external_link_spec.rb b/spec/features/wiki/wiki_page_external_link_spec.rb index 5721c875b3c..97b24bc7e63 100644 --- a/spec/features/wiki/wiki_page_external_link_spec.rb +++ b/spec/features/wiki/wiki_page_external_link_spec.rb @@ -47,8 +47,7 @@ RSpec.describe "Wiki page external link", :js, :selenium do it "opens that link in a new window or tab" do visit project_wiki_path(project, wiki_page) - href = external_redirect_path(url: external_url) - link = page.find_link("OpenProject", href:) + link = page.find_link("OpenProject", href: external_url) new_window = window_opened_by { link.click } within_window new_window do expect(page.current_url).to start_with external_url diff --git a/spec/features/work_packages/details/custom_fields/custom_field_spec.rb b/spec/features/work_packages/details/custom_fields/custom_field_spec.rb index 9858505b795..c8c6dabebd8 100644 --- a/spec/features/work_packages/details/custom_fields/custom_field_spec.rb +++ b/spec/features/work_packages/details/custom_fields/custom_field_spec.rb @@ -251,8 +251,7 @@ RSpec.describe "custom field inplace editor", :js do field.update "http://example.com" field.expect_state_text "http://example.com" - href = external_redirect_path(url: "http://example.com/") - expect(field.display_element).to have_link("http://example.com", href:) + expect(field.display_element).to have_link("http://example.com", href: "http://example.com") field.update "bogus", expect_failure: true @@ -262,8 +261,8 @@ RSpec.describe "custom field inplace editor", :js do field.save! field.expect_state_text "http://community.openproject.org" - href = external_redirect_path(url: "http://community.openproject.org/") - expect(field.display_element).to have_link("http://community.openproject.org", href:) + expect(field.display_element).to have_link("http://community.openproject.org", + href: "http://community.openproject.org") end end end diff --git a/spec/features/work_packages/details/markdown/todolist_spec.rb b/spec/features/work_packages/details/markdown/todolist_spec.rb index 6122708975c..3aead65ebfa 100644 --- a/spec/features/work_packages/details/markdown/todolist_spec.rb +++ b/spec/features/work_packages/details/markdown/todolist_spec.rb @@ -186,11 +186,9 @@ RSpec.describe "Todolists in CKEditor", :js, :selenium do expect(page).to have_css(".op-uc-list--task-checkbox", count: 3) expect(page).to have_css(".op-uc-list--task-checkbox[checked]", count: 1) - link = external_redirect_path(url: "https://community.openproject.com/") - expect(page).to have_css(".op-uc-list--item a[href='#{link}']") + expect(page).to have_css(".op-uc-list--item a[href='https://community.openproject.com/']") - link = external_redirect_path(url: "https://community.openproject.com/nested") - nested_link = page.find(".op-uc-list--item .op-uc-list--item a[href='#{link}']") + nested_link = page.find(".op-uc-list--item .op-uc-list--item a[href='https://community.openproject.com/nested']") expect(nested_link.text).to eq "This is a link" description = WorkPackage.last.description diff --git a/spec/features/wysiwyg/linking_spec.rb b/spec/features/wysiwyg/linking_spec.rb index 9025b6e0949..ea8e67383cb 100644 --- a/spec/features/wysiwyg/linking_spec.rb +++ b/spec/features/wysiwyg/linking_spec.rb @@ -59,7 +59,7 @@ RSpec.describe "Wysiwyg linking", :js do "[http://example.org/link with spaces](http://example.org/link%20with%20spaces)" ) - expect(page).to have_link(href: external_redirect_path(url: "http://example.org/link%20with%20spaces")) + expect(page).to have_link(href: "http://example.org/link%20with%20spaces") end end @@ -76,7 +76,7 @@ RSpec.describe "Wysiwyg linking", :js do editor.insert_link "https://example.org/path" click_on "Save" expect_flash(message: "Successful update.") - expect(page).to have_link(href: external_redirect_path(url: "https://example.org/path")) + expect(page).to have_link(href: "https://example.org/path") end it "allows linking the custom protocol" do