diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-10-14 09:51:05 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-10-14 09:51:05 +0100 |
commit | 55e0b9f75160222d07773f38c8aa67aa9de1487e (patch) | |
tree | 5253e2e570c49b0c2f9b07027858c6f93798aae1 /spec/controllers/public_body_controller_spec.rb | |
parent | c64360898beca1162a1bdef9ca4b76676e0907f8 (diff) | |
parent | 5e1517acfc7b2c46523ca0657d67bdf53299826b (diff) |
Merge branch 'issues/222-category-editing-add-order-interface' into rails-3-develop
Diffstat (limited to 'spec/controllers/public_body_controller_spec.rb')
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index f64975580..fc7143522 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -7,6 +7,7 @@ describe PublicBodyController, "when showing a body" do render_views before(:each) do + PublicBodyCategory.stub!(:load_categories) load_raw_emails_data get_fixtures_xapian_index end @@ -75,6 +76,10 @@ end describe PublicBodyController, "when listing bodies" do render_views + before(:each) do + PublicBodyCategory.stub!(:load_categories) + end + it "should be successful" do get :list response.should be_success @@ -204,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" + 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 => "local_council" + 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') |