From 31c1f47a6bca88b2be9fb463721fb26698e79f82 Mon Sep 17 00:00:00 2001 From: lizconlan Date: Mon, 4 Aug 2014 10:20:05 +0100 Subject: Reinstate automatic loading of categories on get if no categories defined --- spec/models/public_body_category_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/models') 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 -- cgit v1.2.3