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 feature spec for invite resending

Aaron Contrerasdb75b9d40853
diff --git a/spec/features/work_packages/share_spec.rb b/spec/features/work_packages/share_spec.rb
index 010ff5ae340..3f715ce4e8f 100644
--- a/spec/features/work_packages/share_spec.rb
+++ b/spec/features/work_packages/share_spec.rb
@@ -323,6 +323,13 @@ RSpec.describe 'Work package sharing',
share_modal.expect_shared_with(new_user, 'Edit', position: 1)
share_modal.expect_shared_count_of(7)
+ # The invite can be resent
+ share_modal.resend_invite(new_user)
+ share_modal.expect_invite_resent(new_user)
+ perform_enqueued_jobs
+ # Another invitation email sent out to the user
+ expect(ActionMailer::Base.deliveries.size).to eq(2)
+
# The new user can be deleted
share_modal.remove_user(new_user)
share_modal.expect_not_shared_with(new_user)
diff --git a/spec/support/components/work_packages/share_modal.rb b/spec/support/components/work_packages/share_modal.rb
index 9ad2e1e83ef..151701bd16a 100644
--- a/spec/support/components/work_packages/share_modal.rb
+++ b/spec/support/components/work_packages/share_modal.rb
@@ -305,6 +305,19 @@ module Components
end
end
+ def resend_invite(user)
+ within user_row(user) do
+ click_button I18n.t("work_package.sharing.user_details.resend_invite")
+ end
+ end
+
+ def expect_invite_resent(user)
+ within user_row(user) do
+ expect(page)
+ .to have_text(I18n.t("work_package.sharing.user_details.invite_resent"))
+ end
+ end
+
def user_row(user)
shares_list
.find("[data-test-selector=\"op-share-wp-active-user-#{user.id}\"]")