one_time_key_spec.rb 531 B

1234567891011121314151617181920212223
  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