OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Allow banner matcher to receive plan
Oliver Günther8945491e32e5
diff --git a/modules/openid_connect/spec/features/administration/oidc_custom_crud_spec.rb b/modules/openid_connect/spec/features/administration/oidc_custom_crud_spec.rbindex b7a549f9446..60a993f3aff 100644--- a/modules/openid_connect/spec/features/administration/oidc_custom_crud_spec.rb+++ b/modules/openid_connect/spec/features/administration/oidc_custom_crud_spec.rb@@ -175,8 +175,7 @@ RSpec.describe "OIDC administration CRUD",context "without EE", without_ee: %i[sso_auth_providers] doit "renders the upsale page" dovisit "/admin/openid_connect/providers"- expect(page).to have_enterprise_banner- expect(page).to have_text "Available only through the Premium enterprise plan"+ expect(page).to have_enterprise_banner(:premium)endendenddiff --git a/modules/team_planner/spec/features/team_planner_upsale_spec.rb b/modules/team_planner/spec/features/team_planner_upsale_spec.rbindex f749e01aa91..d2b678084dc 100644--- a/modules/team_planner/spec/features/team_planner_upsale_spec.rb+++ b/modules/team_planner/spec/features/team_planner_upsale_spec.rb@@ -43,18 +43,18 @@ RSpec.describe "Team planner index",it "redirects routes to upsale" dovisit team_planners_path- expect(page).to have_text "Upgrade now"+ expect(page).to have_enterprise_upsale_page(:premium)visit project_team_planners_path(project)- expect(page).to have_text "Upgrade now"+ expect(page).to have_enterprise_upsale_page(:premium)visit new_project_team_planners_path(project)- expect(page).to have_text "Upgrade now"+ expect(page).to have_enterprise_upsale_page(:premium)visit project_team_planner_path(project, id: "new")- expect(page).to have_text "Upgrade now"+ expect(page).to have_enterprise_upsale_page(:premium)endenddiff --git a/spec/support/matchers/has_enterprise_banner.rb b/spec/support/matchers/has_enterprise_banner.rbindex c2bcb78ed2c..fc0ef4fc8f2 100644--- a/spec/support/matchers/has_enterprise_banner.rb+++ b/spec/support/matchers/has_enterprise_banner.rb@@ -32,7 +32,12 @@ RSpec::Matchers.define :have_enterprise_banner do |**args|include TestSelectorFindersmatch do |page|- page.has_selector?(test_selector("op-enterprise-banner"), **args)+ if args[:plan]+ expected_text = I18n.t("ee.upsale.plan_text_html", plan: args[:plan].capitalize)+ page.find(test_selector("op-enterprise-banner"), **args, text: expected_text)+ else+ page.find(test_selector("op-enterprise-banner"), **args)+ endendmatch_when_negated do |page|@@ -40,10 +45,16 @@ RSpec::Matchers.define :have_enterprise_banner do |**args|endfailure_message do- "expected page to have Enterprise edition banner"+ <<~MESSAGE+ Expected page to have Enterprise edition banner, but it does not:+ #{@error}+ MESSAGEendfailure_message_when_negated do- "expected page not to have Enterprise edition banner"+ <<~MESSAGE+ Expected page not to have Enterprise edition banner, but it does:+ #{@error}+ MESSAGEendenddiff --git a/spec/support/matchers/has_enterprise_upsale_page.rb b/spec/support/matchers/has_enterprise_upsale_page.rbindex 540cc1f50d4..7d27f2bc601 100644--- a/spec/support/matchers/has_enterprise_upsale_page.rb+++ b/spec/support/matchers/has_enterprise_upsale_page.rb@@ -32,7 +32,12 @@ RSpec::Matchers.define :have_enterprise_upsale_page do |**args|include TestSelectorFindersmatch do |page|- page.has_selector?(test_selector("op-enterprise-upsale-page"), **args)+ if args[:plan]+ expected_text = I18n.t("ee.upsale.plan_text_html", plan: args[:plan].capitalize)+ page.find(test_selector("op-enterprise-upsale-page"), **args, text: expected_text)+ else+ page.find(test_selector("op-enterprise-upsale-page"), **args)+ endendmatch_when_negated do |page|@@ -40,10 +45,16 @@ RSpec::Matchers.define :have_enterprise_upsale_page do |**args|endfailure_message do- "expected page to have Enterprise upsale page"+ <<~MESSAGE+ Expected page to have Enterprise edition upsale page, but it does not:+ #{@error}+ MESSAGEendfailure_message_when_negated do- "expected page not to have Enterprise upsale page"+ <<~MESSAGE+ Expected page not to have Enterprise edition upsale page, but it does:+ #{@error}+ MESSAGEendend