From 395aba8bbcb825b0214db8a1df23fc8da15fdb6f Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 5 Nov 2019 10:06:54 +0100 Subject: [PATCH] Remove administrateur active notion --- app/models/administrateur.rb | 4 ---- spec/models/administrateur_spec.rb | 18 ------------------ 2 files changed, 22 deletions(-) diff --git a/app/models/administrateur.rb b/app/models/administrateur.rb index 2f834f39a..0c43f0eca 100644 --- a/app/models/administrateur.rb +++ b/app/models/administrateur.rb @@ -80,8 +80,4 @@ class Administrateur < ApplicationRecord def can_be_deleted? dossiers.state_instruction_commencee.none? && procedures.none? end - - def active? - user.last_sign_in_at.present? - end end diff --git a/spec/models/administrateur_spec.rb b/spec/models/administrateur_spec.rb index e06c53630..4b9fef1f0 100644 --- a/spec/models/administrateur_spec.rb +++ b/spec/models/administrateur_spec.rb @@ -50,22 +50,4 @@ describe Administrateur, type: :model do # it { expect(subject).to eq([]) } # end # end - - describe '#active?' do - let!(:administrateur) { create(:administrateur) } - - subject { administrateur.active? } - - context 'when the user has never signed in' do - before { administrateur.user.update(last_sign_in_at: nil) } - - it { is_expected.to be false } - end - - context 'when the user has already signed in' do - before { administrateur.user.update(last_sign_in_at: Time.zone.now) } - - it { is_expected.to be true } - end - end end