diff --git a/app/helpers/phase_label_helper.rb b/app/helpers/phase_label_helper.rb index 987170cde..1d7da5d67 100644 --- a/app/helpers/phase_label_helper.rb +++ b/app/helpers/phase_label_helper.rb @@ -3,7 +3,8 @@ def render_phase_label(presented_object, message) if presented_object.respond_to?(:phase) && %w(alpha beta).include?(presented_object.phase) locals = {} locals[:message] = message if message.present? - render partial: "govuk_component/#{presented_object.phase}_label", locals: locals + + render 'govuk_publishing_components/components/phase_banner', locals.merge(phase: presented_object.phase) end end end diff --git a/test/integration/phase_label_test.rb b/test/integration/phase_label_test.rb index b2b4d239e..b5e147ad1 100644 --- a/test/integration/phase_label_test.rb +++ b/test/integration/phase_label_test.rb @@ -9,7 +9,7 @@ class PhaseLabelTest < ActionDispatch::IntegrationTest visit "/government/case-studies/get-britain-building-carlisle-park" - assert page.has_css?("[data-template='govuk_component-alpha_label']") + assert page.has_text?("alpha") end test "No phase label is displayed for a Content item without a phase field" do @@ -19,7 +19,6 @@ class PhaseLabelTest < ActionDispatch::IntegrationTest visit "/government/case-studies/get-britain-building-carlisle-park" - assert page.has_no_css?("[data-template='govuk_component-alpha_label']") - assert page.has_no_css?("[data-template='govuk_component-beta_label']") + refute page.has_text?("alpha") end end