diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-09-24 17:44:43 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-09-24 17:44:43 +0100 |
commit | fd82802023fec28c0e467c0ba2820489d35ddc9c (patch) | |
tree | 93c4ebb80c547b1837d5479782d418607c89a9f0 /spec/controllers | |
parent | 7b7f5dfa21f669b75552e946bedc598174fd71db (diff) |
fixup! Replace existing PublicBodyCategories functionality with db models PublicBodyCategory and PublicBodyHeading
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') |