Skip to content

Commit

Permalink
Spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jarkko committed Oct 6, 2020
1 parent 56d45f8 commit db297e9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/features/two_factor_authenticatable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@
expect(page).to have_content("Enter the code that was sent to you")
end

scenario 'Sends OTP code by SMS' do
login_as user
SMSProvider.messages.clear()
visit dashboard_path
expect(SMSProvider.messages).not_to be_empty
end

scenario "Doesn't sends OTP code by SMS upon every request if so configured" do
login_as user
SMSProvider.messages.clear()
allow(Rails.application.config.devise).to receive(:skip_send_new_otp_in_after_set_user_for).and_return([:user])
visit dashboard_path
expect(SMSProvider.messages).to be_empty
end

scenario 'TFA should be different for different users' do
sms_sign_in

Expand Down

0 comments on commit db297e9

Please sign in to comment.