Skip to content

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

Fix global menu specs

Klaus Zanders377bea616ae9
diff --git a/spec/features/projects/global_menu_item_spec.rb b/spec/features/projects/global_menu_item_spec.rb
index 1ce8b79851a..7bf2ab37020 100644
--- a/spec/features/projects/global_menu_item_spec.rb
+++ b/spec/features/projects/global_menu_item_spec.rb
@@ -56,12 +56,26 @@ RSpec.describe "Projects global menu item", :js, :with_cuprite do
it "renders the preset filters" do
within "#main-menu" do
- expect(page).to have_link text: I18n.t(:"projects.lists.active")
- expect(page).to have_link text: I18n.t(:"projects.lists.my")
- expect(page).to have_link text: I18n.t(:"projects.lists.archived")
- expect(page).to have_link text: I18n.t(:"activerecord.attributes.project.status_codes.on_track")
- expect(page).to have_link text: I18n.t(:"activerecord.attributes.project.status_codes.off_track")
- expect(page).to have_link text: I18n.t(:"activerecord.attributes.project.status_codes.at_risk")
+ expect(page).to have_link text: I18n.t("projects.lists.active")
+ expect(page).to have_link text: I18n.t("projects.lists.my")
+ expect(page).to have_link text: I18n.t("activerecord.attributes.project.status_codes.on_track")
+ expect(page).to have_link text: I18n.t("activerecord.attributes.project.status_codes.off_track")
+ expect(page).to have_link text: I18n.t("activerecord.attributes.project.status_codes.at_risk")
+ end
+ end
+
+ context "with an admin user" do
+ let(:user) { create(:admin) }
+
+ it "renders the archived filter as well" do
+ within "#main-menu" do
+ expect(page).to have_link text: I18n.t("projects.lists.active")
+ expect(page).to have_link text: I18n.t("projects.lists.my")
+ expect(page).to have_link text: I18n.t("projects.lists.archived")
+ expect(page).to have_link text: I18n.t("activerecord.attributes.project.status_codes.on_track")
+ expect(page).to have_link text: I18n.t("activerecord.attributes.project.status_codes.off_track")
+ expect(page).to have_link text: I18n.t("activerecord.attributes.project.status_codes.at_risk")
+ end
end
end
end