Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 'Fix admin password change required for omniauth-only accounts' to v0.27 #11240

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix linting issue
  • Loading branch information
alecslupu committed Jul 19, 2023
commit 5bacd4546dabdc627754b8dbb8a72a01a1986518
6 changes: 3 additions & 3 deletions decidim-core/spec/models/decidim/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 280,7 @@ module Decidim
describe "#needs_password_update?" do
subject { user.needs_password_update? }

let(:user) { create(:user, :confirmed, organization:) }
let(:user) { create(:user, :confirmed, organization: organization) }
let(:password_expired_time) { Decidim.config.admin_password_expiration_days.days.ago - 1.second }

context "with participant" do
Expand All @@ -290,7 290,7 @@ module Decidim
end

context "with admin" do
let(:user) { create(:user, :confirmed, :admin, organization:, password_updated_at:) }
let(:user) { create(:user, :confirmed, :admin, organization: organization, password_updated_at: password_updated_at) }
let(:password_updated_at) { Time.current }

context "when the password has been recently updated" do
Expand All @@ -315,7 315,7 @@ module Decidim
it { is_expected.to be(true) }

context "when the user has identities" do
let!(:identity) { create(:identity, user:) }
let!(:identity) { create(:identity, user: user) }

it { is_expected.to be(false) }
end
Expand Down
Loading