From 3f8ac125625a0b240d33de01166974a85e80b1c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20J=C3=A4ggi?= Date: Tue, 7 Jan 2025 14:47:00 +0100 Subject: [PATCH] Move feature to core --- .../devise/hitobito/passwords_controller.rb | 16 ---------------- .../devise/hitobito/passwords_controller_spec.rb | 12 ------------ 2 files changed, 28 deletions(-) delete mode 100644 app/controllers/sac_cas/devise/hitobito/passwords_controller.rb diff --git a/app/controllers/sac_cas/devise/hitobito/passwords_controller.rb b/app/controllers/sac_cas/devise/hitobito/passwords_controller.rb deleted file mode 100644 index a36db84b2..000000000 --- a/app/controllers/sac_cas/devise/hitobito/passwords_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# Copyright (c) 2024, Schweizer Alpen-Club. This file is part of -# hitobito_sac_cas and licensed under the Affero General Public License version 3 -# or later. See the COPYING file at the top-level directory or at -# https://github.com/hitobito/hitobito_sac_cas - -module SacCas::Devise::Hitobito::PasswordsController - def successfully_sent?(resource) - if resource.login? - super - else - flash[:notice] = I18n.translate("devise.failure.signin_not_allowed") - end - end -end diff --git a/spec/controllers/devise/hitobito/passwords_controller_spec.rb b/spec/controllers/devise/hitobito/passwords_controller_spec.rb index a4217daf0..214c63041 100644 --- a/spec/controllers/devise/hitobito/passwords_controller_spec.rb +++ b/spec/controllers/devise/hitobito/passwords_controller_spec.rb @@ -25,16 +25,4 @@ expect(user.wso2_legacy_password_salt).to be_nil end end - - describe "#post" do - it "does not tell if email exists in db in flash message when it does not exist" do - post :create, params: {person: {email: user.email}} - expect(flash[:notice]).to eq "Wenn uns die angegebene E-Mail-Adresse bekannt ist, solltest du in den nächsten Minuten eine E-Mail erhalten, mit der du dein Passwort zurücksetzen kannst (bitte schaue auch in deinem Spam-Ordner nach)" - end - - it "does not tell if email exists in db in flash message when it does not exist" do - post :create, params: {person: {email: "thisemaildoesnotexistindb@hitobito.com"}} - expect(flash[:notice]).to eq "Wenn uns die angegebene E-Mail-Adresse bekannt ist, solltest du in den nächsten Minuten eine E-Mail erhalten, mit der du dein Passwort zurücksetzen kannst (bitte schaue auch in deinem Spam-Ordner nach)" - end - end end