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

Rename Overview to Dashboard in feature specs

Alexander Brandon Coles1b903655914b
diff --git a/modules/calendar/spec/features/calendar_widget_spec.rb b/modules/calendar/spec/features/calendar_widget_spec.rb
index 20d4e2fc430..9fd624ab5e4 100644
--- a/modules/calendar/spec/features/calendar_widget_spec.rb
+++ b/modules/calendar/spec/features/calendar_widget_spec.rb
@@ -27,7 +27,7 @@
#++
require "spec_helper"
-require_relative "../../../overviews/spec/support/pages/overview"
+require_relative "../../../overviews/spec/support/pages/dashboard"
require_relative "../support/pages/calendar"
RSpec.describe "Calendar Widget", :js, with_settings: { start_of_week: 1 } do
@@ -44,8 +44,8 @@ RSpec.describe "Calendar Widget", :js, with_settings: { start_of_week: 1 } do
create(:meeting, title: "Weekly", project:, start_time: Time.zone.today.beginning_of_week.next_occurring(:tuesday) + 10.hours)
end
- let(:overview_page) do
- Pages::Overview.new(project)
+ let(:dashboard_page) do
+ Pages::Dashboard.new(project)
end
let(:wp_full_view) { Pages::FullWorkPackage.new(work_package, project) }
let(:calendar) { Pages::Calendar.new project }
@@ -59,14 +59,14 @@ RSpec.describe "Calendar Widget", :js, with_settings: { start_of_week: 1 } do
before do
login_as(current_user)
- overview_page.visit!
+ dashboard_page.visit!
wait_for_network_idle if using_cuprite?
# within top-left area, add an additional widget
- overview_page.add_widget(1, 1, :row, "Calendar")
+ dashboard_page.add_widget(1, 1, :row, "Calendar")
- overview_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
end
it "shows the meeting" do
@@ -102,13 +102,13 @@ RSpec.describe "Calendar Widget", :js, with_settings: { start_of_week: 1 } do
expect(page).to have_css(".fc-event-title", text: work_package.subject)
calendar.resize_date(work_package, work_package.due_date - 1.day)
- overview_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
work_package.reload
expect(work_package.due_date).to eq Time.zone.today.beginning_of_week.next_occurring(:wednesday)
calendar.resize_date(work_package, work_package.due_date - 1.day)
- overview_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
work_package.reload
expect(work_package.due_date).to eq Time.zone.today.beginning_of_week.next_occurring(:tuesday)
diff --git a/modules/overviews/spec/features/low_permissions_page_creation_spec.rb b/modules/overviews/spec/features/low_permissions_page_creation_spec.rb
index c87391b88d3..c8c313ca6f7 100644
--- a/modules/overviews/spec/features/low_permissions_page_creation_spec.rb
+++ b/modules/overviews/spec/features/low_permissions_page_creation_spec.rb
@@ -28,9 +28,9 @@
require "spec_helper"
-require_relative "../support/pages/overview"
+require_relative "../support/pages/dashboard"
-RSpec.describe "Overview page on the fly creation if user lacks :manage_overview permission", :js do
+RSpec.describe "Dashboard page on the fly creation if user lacks :manage_overview permission", :js do
let!(:type) { create(:type) }
let!(:project) { create(:project, types: [type]) }
let!(:open_status) { create(:default_status) }
@@ -43,14 +43,14 @@ RSpec.describe "Overview page on the fly creation if user lacks :manage_overview
create(:user,
member_with_permissions: { project => permissions })
end
- let(:overview_page) do
- Pages::Overview.new(project)
+ let(:dashboard_page) do
+ Pages::Dashboard.new(project)
end
before do
login_as user
- overview_page.visit!
+ dashboard_page.visit!
end
it "renders the default view, allows altering and saving" do
diff --git a/modules/overviews/spec/features/managing_overview_page_spec.rb b/modules/overviews/spec/features/managing_dashboard_page_spec.rb
similarity index 89%
rename from modules/overviews/spec/features/managing_overview_page_spec.rb
rename to modules/overviews/spec/features/managing_dashboard_page_spec.rb
index 24579e23f1c..13de2749373 100644
--- a/modules/overviews/spec/features/managing_overview_page_spec.rb
+++ b/modules/overviews/spec/features/managing_dashboard_page_spec.rb
@@ -28,9 +28,9 @@
require "spec_helper"
-require_relative "../support/pages/overview"
+require_relative "../support/pages/dashboard"
-RSpec.describe "Overview page managing", :js do
+RSpec.describe "Dashboard page managing", :js do
let!(:type) { create(:type) }
let!(:project) { create(:project, types: [type], description: "My **custom** description") }
let!(:open_status) { create(:default_status) }
@@ -74,15 +74,15 @@ RSpec.describe "Overview page managing", :js do
})
end
- let(:overview_page) do
- Pages::Overview.new(project)
+ let(:dashboard_page) do
+ Pages::Dashboard.new(project)
end
context "as a user with permission" do
before do
login_as user
- overview_page.visit!
+ dashboard_page.visit!
end
it "renders the default view, allows altering and saving" do
@@ -107,17 +107,17 @@ RSpec.describe "Overview page managing", :js do
end
# within top-left area, add an additional widget
- overview_page.add_widget(1, 1, :row, "Work packages table")
+ dashboard_page.add_widget(1, 1, :row, "Work packages table")
# Actually there are two success messages displayed currently. One for the grid getting updated and one
# for the query assigned to the new widget being created. A user will not notice it but the automated
# browser can get confused. Therefore we dismiss it twice.
- overview_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
# Fixing flaky spec: for some reason, the second request to load the table is not executed until
# some activity happens on the page. Sending an enter key to trigger the second request.
page.find("body").send_keys(:enter)
- overview_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
table_area = Components::Grids::GridArea.new(".grid--area.-widgeted:nth-of-type(5)")
table_area.expect_to_span(1, 1, 2, 2)
@@ -125,13 +125,13 @@ RSpec.describe "Overview page managing", :js do
# A useless resizing shows no message and does not alter the size
table_area.resize_to(1, 1)
- overview_page.expect_no_toaster message: I18n.t("js.notice_successful_update")
+ dashboard_page.expect_no_toaster message: I18n.t("js.notice_successful_update")
table_area.expect_to_span(1, 1, 2, 2)
table_area.resize_to(1, 2)
- overview_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")
# Resizing leads to the table area now spanning a larger area
table_area.expect_to_span(1, 1, 2, 3)
@@ -147,7 +147,7 @@ RSpec.describe "Overview page managing", :js do
# Reloading kept the user's values
visit home_path
- overview_page.visit!
+ dashboard_page.visit!
## Because of the added column and the resizing the other widgets have moved down
# For unknown, undesired reasons, the project description no longer spans two rows.
@@ -199,13 +199,13 @@ RSpec.describe "Overview page managing", :js do
before do
login_as user_without_permission
- overview_page.visit!
+ dashboard_page.visit!
end
it "does not show the option to add widgets" do
# Neither hover effects
- overview_page.expect_unable_to_add_widget(1, 1, :column, nil)
- overview_page.expect_unable_to_add_widget(1, 1, :row, nil)
+ dashboard_page.expect_unable_to_add_widget(1, 1, :column, nil)
+ dashboard_page.expect_unable_to_add_widget(1, 1, :row, nil)
# nor a create button are shown
expect(page).to have_no_test_selector("overview--add-widgets-button")
diff --git a/modules/overviews/spec/support/pages/dashboard.rb b/modules/overviews/spec/support/pages/dashboard.rb
new file mode 100644
index 00000000000..1a53458999a
--- /dev/null
+++ b/modules/overviews/spec/support/pages/dashboard.rb
@@ -0,0 +1,49 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+require "support/pages/page"
+
+require_relative "../../../../grids/spec/support/pages/grid"
+
+module Pages
+ class Dashboard < ::Pages::Grid
+ attr_accessor :project
+
+ def initialize(project)
+ super()
+
+ @project = project
+ end
+
+ def path
+ dashboard_project_overview_path(project)
+ end
+ end
+end
diff --git a/modules/overviews/spec/support/pages/overview.rb b/modules/overviews/spec/support/pages/overview.rb
index e62e80ee71b..ed3a4957f86 100644
--- a/modules/overviews/spec/support/pages/overview.rb
+++ b/modules/overviews/spec/support/pages/overview.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
@@ -28,18 +30,18 @@
require "support/pages/page"
-require_relative "../../../../grids/spec/support/pages/grid"
-
module Pages
- class Overview < ::Pages::Grid
+ class Overview < ::Pages::Page
attr_accessor :project
def initialize(project)
- self.project = project
+ super()
+
+ @project = project
end
def path
- dashboard_project_overview_path(project)
+ project_overview_path(project)
end
end
end