summaryrefslogtreecommitdiff
path: root/spec/models/key_spec.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2012-08-29 11:36:02 -0400
committerRobert Speicher <rspeicher@gmail.com>2012-08-29 11:36:02 -0400
commit97423a0bed1148f65f9ed2bd8bf540e764d9576c (patch)
treed91a67a6a863a97b8cf2acd76b01c18de08c2dc5 /spec/models/key_spec.rb
parent2bdea8651fa3bd82418986ada84828c22d451405 (diff)
downloadgitlab-ce-97423a0bed1148f65f9ed2bd8bf540e764d9576c.tar.gz
Add more coverage for model validations and associations
Diffstat (limited to 'spec/models/key_spec.rb')
-rw-r--r--spec/models/key_spec.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb
index 6efb21e9086..85cd291d681 100644
--- a/spec/models/key_spec.rb
+++ b/spec/models/key_spec.rb
@@ -2,12 +2,15 @@ require 'spec_helper'
describe Key do
describe "Associations" do
- it { should belong_to(:user) or belong_to(:project) }
+ it { should belong_to(:user) }
+ it { should belong_to(:project) }
end
describe "Validation" do
it { should validate_presence_of(:title) }
it { should validate_presence_of(:key) }
+ it { should ensure_length_of(:title).is_within(0..255) }
+ it { should ensure_length_of(:key).is_within(0..5000) }
end
describe "Methods" do