diff --git a/app/controllers/homepage_controller.rb b/app/controllers/homepage_controller.rb index 6797f815ea..ebc18d40f5 100644 --- a/app/controllers/homepage_controller.rb +++ b/app/controllers/homepage_controller.rb @@ -11,6 +11,10 @@ def index helper_method :new_design? def new_design? - params[:new_design] == "impact" + (params[:new_design] == "impact") && integration_feature_flag? + end + + def integration_feature_flag? + ENV["NEW_DESIGN"].present? end end diff --git a/test/integration/homepage_test.rb b/test/integration/homepage_test.rb index dfb78a14ea..72e5efa5a1 100644 --- a/test/integration/homepage_test.rb +++ b/test/integration/homepage_test.rb @@ -13,10 +13,12 @@ class HomepageTest < ActionDispatch::IntegrationTest context "when new design paramater is present" do should "show the new design" do - visit "/?new_design=impact" + ClimateControl.modify NEW_DESIGN: "impact" do + visit "/?new_design=impact" - assert page.has_css?(".homepage-header__title") - assert page.has_no_css?(".homepage-inverse-header__title") + assert page.has_css?(".homepage-header__title") + assert page.has_no_css?(".homepage-inverse-header__title") + end end end