Welcome to mirror list, hosted at ThFree Co, Russian Federation.

devise_spec.rb « strategies « otp « auth « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e51705bdb9ced539b10760222d726387ea6d567c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Auth::Otp::Strategies::Devise do
  let_it_be(:user) { create(:user) }

  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