diff options
author | Rubén Dávila <ruben@gitlab.com> | 2017-09-28 21:26:16 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2017-10-05 16:25:27 +0300 |
commit | b27549df97151f773c6fbfac4c9dc3aa491a8b5d (patch) | |
tree | 2eeb19000452adf02914e583020d9e024327ac2d /spec/models/gpg_key_subkey_spec.rb | |
parent | 4b6d045c0c3c8d8ab70dd80feb960f193e498d7a (diff) |
Add some basic specs and refactor model and validations
Diffstat (limited to 'spec/models/gpg_key_subkey_spec.rb')
-rw-r--r-- | spec/models/gpg_key_subkey_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/gpg_key_subkey_spec.rb b/spec/models/gpg_key_subkey_spec.rb new file mode 100644 index 00000000000..3c86837f47f --- /dev/null +++ b/spec/models/gpg_key_subkey_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +describe GpgKeySubkey do + subject { build(:gpg_key_subkey) } + + describe 'associations' do + it { is_expected.to belong_to(:gpg_key) } + end + + describe 'validations' do + it { is_expected.to validate_presence_of(:gpg_key_id) } + it { is_expected.to validate_presence_of(:fingerprint) } + it { is_expected.to validate_presence_of(:keyid) } + end +end |