diff options
author | Matt Jankowski <matt@jankowski.online> | 2023-03-04 11:00:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-04 17:00:00 +0100 |
commit | c40d5e5a8fb02f2c603a23a1b0130b3f86a15710 (patch) | |
tree | c9c107c48bf66a957ffc70d72c41fc066a4560e7 /spec/models/one_time_key_spec.rb | |
parent | 2f606ba1220edf29e805296939f4e5612721bbf0 (diff) |
Misc coverage improvements for validators (#23928)
Diffstat (limited to 'spec/models/one_time_key_spec.rb')
-rw-r--r-- | spec/models/one_time_key_spec.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/models/one_time_key_spec.rb b/spec/models/one_time_key_spec.rb index 2a5fe8a9d..6ff7ffc5c 100644 --- a/spec/models/one_time_key_spec.rb +++ b/spec/models/one_time_key_spec.rb @@ -2,5 +2,22 @@ require 'rails_helper' -RSpec.describe OneTimeKey, type: :model do +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 |