From 99a191bf3575db0c99c4cd93bb4b628f5cd62565 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 29 Nov 2023 19:41:26 +0100 Subject: [PATCH] Refs #32848 - Ensure the Foreman version is nightly in tests This copies the behavior of the stable release test for nightly to avoid breaking on stable branches. (cherry picked from commit 7e637558e7b37d4ee2fa4335fc64e415e1609914) --- test/controllers/links_controller_test.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/controllers/links_controller_test.rb b/test/controllers/links_controller_test.rb index 40133743fca..2e1b475dc32 100644 --- a/test/controllers/links_controller_test.rb +++ b/test/controllers/links_controller_test.rb @@ -72,13 +72,15 @@ class LinksControllerTest < ActionController::TestCase end test 'new docs on nightly' do - get :show, params: { - type: 'docs', - section: 'TestSection', - chapter: 'TestChapter', - } + with_temporary_settings(version: Foreman::Version.new('3.10-develop')) do + get :show, params: { + type: 'docs', + section: 'TestSection', + chapter: 'TestChapter', + } - assert_redirected_to %r{https://docs\.theforeman\.org/nightly/TestSection/index-(foreman-(deb|el)|katello)\.html#TestChapter} + assert_redirected_to %r{https://docs\.theforeman\.org/nightly/TestSection/index-(foreman-(deb|el)|katello)\.html#TestChapter} + end end test 'new docs on a stable release' do