2023-02-22 11:55:31 +11:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-06-03 03:24:53 +10:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-09-04 15:12:25 +10:00
|
|
|
RSpec.describe OneTimeKey do
|
2023-03-05 03:00:00 +11:00
|
|
|
describe 'validations' do
|
|
|
|
context 'with an invalid signature' do
|
|
|
|
let(:one_time_key) { Fabricate.build(:one_time_key, signature: 'wrong!') }
|
|
|
|
|
|
|
|
it 'is invalid' do
|
|
|
|
expect(one_time_key).to_not be_valid
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with an invalid key' do
|
|
|
|
let(:one_time_key) { Fabricate.build(:one_time_key, key: 'wrong!') }
|
|
|
|
|
|
|
|
it 'is invalid' do
|
|
|
|
expect(one_time_key).to_not be_valid
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-06-03 03:24:53 +10:00
|
|
|
end
|