diff options
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index 6ff1a7215..fc7143522 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -209,16 +209,19 @@ describe PublicBodyController, "when listing bodies" do end end - it "should list a tagged thing on the appropriate list page, and others on the other page, and all still on the all page" do - load_test_categories - - public_bodies(:humpadink_public_body).tag_string = "foo local_council" - - get :list, :tag => "local_council" + it "should list a tagged thing on the appropriate list page, and others on the other page, + and all still on the all page" do + category = FactoryGirl.create(:public_body_category) + heading = FactoryGirl.create(:public_body_heading) + PublicBodyCategoryLink.create(:public_body_heading_id => heading.id, + :public_body_category_id => category.id) + public_bodies(:humpadink_public_body).tag_string = category.category_tag + + get :list, :tag => category.category_tag response.should render_template('list') assigns[:public_bodies].should == [ public_bodies(:humpadink_public_body) ] - assigns[:tag].should == "local_council" - assigns[:description].should == "in the category ‘Local councils’" + assigns[:tag].should == category.category_tag + assigns[:description].should == "in the category ‘#{category.title}’" get :list, :tag => "other" response.should render_template('list') |