2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2017-04-19 10:09:54 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
require 'lib/auth/backend_examples'
|
|
|
|
|
|
|
|
RSpec.describe Auth::Base do
|
|
|
|
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:instance) { described_class.new({ adapter: described_class.name }) }
|
|
|
|
|
2020-02-18 19:51:31 +00:00
|
|
|
describe '#valid?' do
|
2017-04-19 10:09:54 +00:00
|
|
|
it_behaves_like 'Auth backend'
|
|
|
|
|
|
|
|
it "requires an implementation of the 'valid?' method" do
|
|
|
|
|
|
|
|
expect do
|
|
|
|
instance.valid?(user, 'password')
|
|
|
|
end.to raise_error(RuntimeError)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|