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

Add test case for quoting multiple restricted and unrestricted comments

Kabiru Mwenja1aea41542e89
diff --git a/spec/features/activities/work_package/restricted_visibility_comments_spec.rb b/spec/features/activities/work_package/restricted_visibility_comments_spec.rb
index dc7e86ef82b..1b9fbecfc41 100644
--- a/spec/features/activities/work_package/restricted_visibility_comments_spec.rb
+++ b/spec/features/activities/work_package/restricted_visibility_comments_spec.rb
@@ -138,8 +138,15 @@ RSpec.describe "Work package comments with restricted visibility",
context "with a user that is allowed to view, create and edit all comments" do
current_user { project_admin }
+ let(:unrestricted_comment) do
+ create(:work_package_journal,
+ user: project_admin, notes: "An unrestricted comment by member",
+ journable: work_package, version: (work_package.journals.reload.last.version + 1), restricted: false)
+ end
+
before do
first_comment
+ unrestricted_comment
wp_page.visit!
wp_page.wait_for_activity_tab
@@ -158,6 +165,11 @@ RSpec.describe "Work package comments with restricted visibility",
page.within_test_selector("op-work-package-journal-form-element") do
expect(page).to have_checked_field("Restrict visibility")
end
+
+ activity_tab.quote_comment(unrestricted_comment)
+ page.within_test_selector("op-work-package-journal-form-element") do
+ expect(page).to have_checked_field("Restrict visibility")
+ end
end
end