base_spec.rb 436 B

12345678910111213141516171819
  1. require 'rails_helper'
  2. require 'lib/auth/backend_examples'
  3. RSpec.describe Auth::Base do
  4. let(:user) { create(:user) }
  5. let(:instance) { described_class.new({ adapter: described_class.name }) }
  6. describe '#valid?' do
  7. it_behaves_like 'Auth backend'
  8. it "requires an implementation of the 'valid?' method" do
  9. expect do
  10. instance.valid?(user, 'password')
  11. end.to raise_error(RuntimeError)
  12. end
  13. end
  14. end