Skip to content

Commit adffea7

Browse files
committed
Fix sprint goal heading assertion
Match feature-spec headings exactly when identifying one concrete title. This avoids selecting headings that merely include the expected text, such as the sprint blankslate heading generated from the sprint name.
1 parent 9cd5315 commit adffea7

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

modules/backlogs/spec/features/burndown/show_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
planning_page.click_in_sprint_menu(sprint, "Burndown chart")
5252

5353
expect(page)
54-
.to have_heading(sprint.name, level: 2)
54+
.to have_heading(sprint.name, level: 2, exact: true)
5555
expect(page)
56-
.to have_content "#{sprint.start_date.strftime('%m/%d/%Y')}#{sprint.finish_date.strftime('%m/%d/%Y')}"
56+
.to have_text "#{sprint.start_date.strftime('%m/%d/%Y')}#{sprint.finish_date.strftime('%m/%d/%Y')}"
5757
expect(page)
5858
.to have_element :"opce-burndown-chart"
5959
end

modules/backlogs/spec/features/empty_backlogs_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@
4949

5050
it "shows blankslate with description" do
5151
within "#owner_backlogs_container .blankslate" do
52-
expect(page).to have_heading("Backlog inbox is empty")
52+
expect(page).to have_heading("Backlog inbox is empty", exact: true)
5353
expect(page).to have_text("All open work packages in this project will automatically appear here.")
5454
end
5555

5656
within "#sprint_backlogs_container .blankslate" do
57-
expect(page).to have_heading("No sprints present yet")
57+
expect(page).to have_heading("No sprints present yet", exact: true)
5858
expect(page).to have_text("To start planning your sprint, create one here")
5959
expect(page).to have_link("project settings")
6060
end
@@ -67,12 +67,12 @@
6767

6868
it "shows a blankslate without description" do
6969
within "#owner_backlogs_container .blankslate" do
70-
expect(page).to have_heading("Backlog inbox is empty")
70+
expect(page).to have_heading("Backlog inbox is empty", exact: true)
7171
expect(page).to have_text("All open work packages in this project will automatically appear here.")
7272
end
7373

7474
within "#sprint_backlogs_container .blankslate" do
75-
expect(page).to have_heading("No sprints present yet")
75+
expect(page).to have_heading("No sprints present yet", exact: true)
7676
expect(page).to have_text("No sprints are available for this project yet.")
7777
end
7878
end

modules/backlogs/spec/features/projects/settings/backlog_sharing_settings_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
it "does not show the sharing tab and forbids direct route access" do
134134
visit project_settings_backlogs_path(project)
135135

136-
expect(page).to have_heading(I18n.t(:label_backlogs))
136+
expect(page).to have_heading(I18n.t(:label_backlogs), exact: true)
137137
expect(page).to have_no_link(I18n.t("backlogs.sharing"))
138138

139139
visit project_settings_backlog_sharing_path(project)

modules/backlogs/spec/support/pages/backlog.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def expect_sprint_names_in_order(*sprint_names)
339339
def expect_sprint_heading_with_goal(sprint_name, goal_text)
340340
within(:section, sprint_name) do
341341
expect(page)
342-
.to have_heading(sprint_name, level: 4, accessible_description: goal_text)
342+
.to have_heading(sprint_name, level: 4, accessible_description: goal_text, exact: true)
343343
end
344344
end
345345

0 commit comments

Comments
 (0)