aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
diff options
context:
space:
mode:
authorlizconlan <liz@mysociety.org>2014-08-04 10:20:05 +0100
committerLouise Crow <louise.crow@gmail.com>2014-09-22 12:39:03 +0100
commit31c1f47a6bca88b2be9fb463721fb26698e79f82 (patch)
tree5aaf4cc10898d961bce126088c5574266f792f51 /spec/models
parent373ee8b3ee6835b81fb7eb4ffec59db41b3925c1 (diff)
Reinstate automatic loading of categories on get if no categories defined
Diffstat (limited to 'spec/models')
-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 9ec99e395..8c0adbcc6 100644
--- a/spec/models/public_body_category_spec.rb
+++ b/spec/models/public_body_category_spec.rb
@@ -35,6 +35,12 @@ describe PublicBodyCategory do
it 'should return a list of headings' do
PublicBodyCategory::get().headings().should == ['Local and regional', 'Miscellaneous']
end
+
+ it 'should call load_categories if categories are not already loaded' do
+ PublicBodyCategory.stub!(:count).and_return(0)
+ PublicBodyCategory.should_receive(:load_categories)
+ PublicBodyCategory::get()
+ end
end
describe 'when asked for tags by headings' do