aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-12-01 12:16:52 +0000
committerLouise Crow <louise.crow@gmail.com>2014-12-01 12:16:52 +0000
commitd40aa95b320ded8f43231490acb11f109cbe7985 (patch)
treefa7c1e0c035ad3ab90c581f3dc00137958780767 /spec
parent6a25a188fd367a58f65edac7ec67882a83429b6d (diff)
Validate the presence of the description.
It's required in [PublicBody#type_of_authority]( https://github.com/mysociety/alaveteli/blob/rails-3-develop/app/models/public_body.rb#L343-L347)
Diffstat (limited to 'spec')
-rw-r--r--spec/models/public_body_category_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/public_body_category_spec.rb b/spec/models/public_body_category_spec.rb
index 2d39a7376..c185a3169 100644
--- a/spec/models/public_body_category_spec.rb
+++ b/spec/models/public_body_category_spec.rb
@@ -61,5 +61,11 @@ describe PublicBodyCategory do
existing = FactoryGirl.create(:public_body_category)
PublicBodyCategory.new(:email => existing.category_tag).should_not be_valid
end
+
+ it 'should require a description' do
+ category = PublicBodyCategory.new
+ category.should_not be_valid
+ category.errors[:description].should == ["Description can't be blank"]
+ end
end
end