diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-12-12 20:44:56 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-12-12 20:52:06 +0300 |
commit | eb839b9af51d411a6a35786a1c1c58954da1a650 (patch) | |
tree | 88a8ff1084be1a7bacf2b1557e04c5aa48434b6f /spec/models/key_spec.rb | |
parent | ce867db6b8b1b317ebe864d36d50fde5aad787d4 (diff) | |
parent | 3445136b9b0b8367b151170509fabe613389a50d (diff) |
Merge CSS
Diffstat (limited to 'spec/models/key_spec.rb')
-rw-r--r-- | spec/models/key_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb index c5a5467ca99..7758b7ffa97 100644 --- a/spec/models/key_spec.rb +++ b/spec/models/key_spec.rb @@ -9,9 +9,13 @@ describe Key, models: true do describe "Validation" do it { is_expected.to validate_presence_of(:title) } + it { is_expected.to validate_length_of(:title).is_at_most(255) } + it { is_expected.to validate_presence_of(:key) } - it { is_expected.to validate_length_of(:title).is_within(0..255) } - it { is_expected.to validate_length_of(:key).is_within(0..5000) } + it { is_expected.to validate_length_of(:key).is_at_most(5000) } + it { is_expected.to allow_value('ssh-foo').for(:key) } + it { is_expected.to allow_value('ecdsa-foo').for(:key) } + it { is_expected.not_to allow_value('foo-bar').for(:key) } end describe "Methods" do |