You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
531 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe OneTimeKey do
  4. describe 'validations' do
  5. context 'with an invalid signature' do
  6. let(:one_time_key) { Fabricate.build(:one_time_key, signature: 'wrong!') }
  7. it 'is invalid' do
  8. expect(one_time_key).to_not be_valid
  9. end
  10. end
  11. context 'with an invalid key' do
  12. let(:one_time_key) { Fabricate.build(:one_time_key, key: 'wrong!') }
  13. it 'is invalid' do
  14. expect(one_time_key).to_not be_valid
  15. end
  16. end
  17. end
  18. end