diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-08-29 19:36:02 +0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-08-29 19:36:02 +0400 |
commit | 97423a0bed1148f65f9ed2bd8bf540e764d9576c (patch) | |
tree | d91a67a6a863a97b8cf2acd76b01c18de08c2dc5 /spec/models/wiki_spec.rb | |
parent | 2bdea8651fa3bd82418986ada84828c22d451405 (diff) |
Add more coverage for model validations and associations
Diffstat (limited to 'spec/models/wiki_spec.rb')
-rw-r--r-- | spec/models/wiki_spec.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/models/wiki_spec.rb b/spec/models/wiki_spec.rb index 8035280daa8..de6ce426331 100644 --- a/spec/models/wiki_spec.rb +++ b/spec/models/wiki_spec.rb @@ -4,10 +4,12 @@ describe Wiki do describe "Associations" do it { should belong_to(:project) } it { should belong_to(:user) } + it { should have_many(:notes).dependent(:destroy) } end describe "Validation" do it { should validate_presence_of(:title) } + it { should ensure_length_of(:title).is_within(1..250) } it { should validate_presence_of(:content) } it { should validate_presence_of(:user_id) } end |