debian-mirror-gitlab/spec/lib/gitlab/auth/otp/strategies/devise_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
362 B
Ruby
Raw Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Auth::Otp::Strategies::Devise do
let_it_be(:user) { create(:user) }
2021-04-29 21:17:54 +05:30
2021-01-03 14:25:43 +05:30
let(:otp_code) { 42 }
subject(:validate) { described_class.new(user).validate(otp_code) }
it 'calls Devise' do
expect(user).to receive(:validate_and_consume_otp!).with(otp_code)
validate
end
end