about summary refs log tree commit diff
path: root/spec/models/one_time_key_spec.rb
blob: 6ff7ffc5c148e3c562ea00e7500571c2f8b09620 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require 'rails_helper'

describe OneTimeKey do
  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
end