diff options
author | lizconlan <liz@mysociety.org> | 2014-11-14 14:05:43 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-11-19 13:41:31 +0000 |
commit | bce02be0a6cab397bba9470126e38ff67ee7465d (patch) | |
tree | 9288db17741e212b9fb8ef9c20ff1a89b8e89ea6 /spec/controllers | |
parent | 0ceaec8e0f0ff2ec49b74d49805f3f7b4cd8e953 (diff) |
Remove restricton on deleting PublicBodyHeadings with associated PublicBodyCategories
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/admin_public_body_headings_controller_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/controllers/admin_public_body_headings_controller_spec.rb b/spec/controllers/admin_public_body_headings_controller_spec.rb index 31517d238..bf635c7c2 100644 --- a/spec/controllers/admin_public_body_headings_controller_spec.rb +++ b/spec/controllers/admin_public_body_headings_controller_spec.rb @@ -104,16 +104,19 @@ describe AdminPublicBodyHeadingsController do @heading = FactoryGirl.create(:public_body_heading) end - it "does not destroy a public body heading that has associated categories" do + it "destroys a public body heading that has associated categories" do category = FactoryGirl.create(:public_body_category) link = FactoryGirl.create(:public_body_category_link, :public_body_category => category, :public_body_heading => @heading, :category_display_order => 0) n = PublicBodyHeading.count + n_links = PublicBodyCategoryLink.count + post :destroy, { :id => @heading.id } - response.should redirect_to(edit_admin_heading_path(@heading)) - PublicBodyHeading.count.should == n + response.should redirect_to(admin_categories_path) + PublicBodyHeading.count.should == n - 1 + PublicBodyCategoryLink.count.should == n_links - 1 end it "destroys an empty public body heading" do |