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

Adapt password change spec

Oliver Güntherc167eb5ccd9c
diff --git a/app/controllers/concerns/accounts/user_password_change.rb b/app/controllers/concerns/accounts/user_password_change.rb
index c4b602d7c95..e222950ef56 100644
--- a/app/controllers/concerns/accounts/user_password_change.rb
+++ b/app/controllers/concerns/accounts/user_password_change.rb
@@ -65,7 +65,7 @@ module Accounts::UserPasswordChange
flash[:error] = message unless message.nil?
@user = user
@username = user.login
- render "my/password", locals: { show_user_name: }
+ render "my/password", locals: { show_user_name: }, status: :unprocessable_entity
end
##
diff --git a/spec/features/users/password_change_spec.rb b/spec/features/users/password_change_spec.rb
index ecc1daa41ad..e20bf315bb9 100644
--- a/spec/features/users/password_change_spec.rb
+++ b/spec/features/users/password_change_spec.rb
@@ -90,6 +90,7 @@ RSpec.describe "random password generation", :js, :with_cuprite do
expect(Sessions::UserSession.for_user(user.id).count).to be >= 1
click_on "Save"
+ wait_for_network_idle
expect_flash(type: :info, message: I18n.t(:notice_account_password_updated))
# The old session is removed
diff --git a/spec/support/authentication_helpers.rb b/spec/support/authentication_helpers.rb
index 46350446246..57ef1c63edd 100644
--- a/spec/support/authentication_helpers.rb
+++ b/spec/support/authentication_helpers.rb
@@ -64,7 +64,9 @@ module AuthenticationHelpers
num_days: I18n.t("datetime.distance_in_words.x_days", count: Setting.autologin))
check autologin_label
end
+
click_button I18n.t(:button_login)
+ wait_for_network_idle
end
end