[fix #4361] administrateur active
This commit is contained in:
parent
2a052ab1ac
commit
8ae592fe25
7 changed files with 29 additions and 34 deletions
|
@ -50,4 +50,22 @@ 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue