gitlabhq/spec/models/wiki_spec.rb

17 lines
448 B
Ruby
Raw Normal View History

2012-03-28 21:53:45 +02:00
require 'spec_helper'
describe Wiki do
describe "Associations" do
it { should belong_to(:project) }
it { should belong_to(:user) }
it { should have_many(:notes).dependent(:destroy) }
2012-03-28 21:53:45 +02:00
end
describe "Validation" do
it { should validate_presence_of(:title) }
it { should ensure_length_of(:title).is_within(1..250) }
2012-03-28 21:53:45 +02:00
it { should validate_presence_of(:content) }
it { should validate_presence_of(:user_id) }
end
end