aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-09-24 12:38:51 +0100
committerLouise Crow <louise.crow@gmail.com>2014-09-24 13:34:57 +0100
commit8a638b3db152652fdfa988e1d3bee552b2a0dc3d (patch)
tree993701d185820a6b301a1afcee843d561ba1ec42 /spec/controllers
parent94bc109263690ad336b8fb57ee3ed80f26df7f10 (diff)
fixup! New heading associations should be added on category create.
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/admin_public_body_category_controller_spec.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/spec/controllers/admin_public_body_category_controller_spec.rb b/spec/controllers/admin_public_body_category_controller_spec.rb
index 6c14c5d93..649331884 100644
--- a/spec/controllers/admin_public_body_category_controller_spec.rb
+++ b/spec/controllers/admin_public_body_category_controller_spec.rb
@@ -34,16 +34,13 @@ describe AdminPublicBodyCategoryController do
it "saves the public body category's heading associations" do
heading = FactoryGirl.create(:public_body_heading)
+ category_attributes = FactoryGirl.attributes_for(:public_body_category)
post :create, {
- :public_body_category => {
- :title => 'New Category',
- :category_tag => 'new_test_category',
- :description => 'New category for testing stuff'
- },
- :headings => {"heading_#{heading.id}" => heading.id}
+ :public_body_category => category_attributes,
+ :headings => {"heading_#{heading.id}" => heading.id}
}
request.flash[:notice].should include('successful')
- category = PublicBodyCategory.find_by_title("New Category")
+ category = PublicBodyCategory.find_by_title(category_attributes[:title])
category.public_body_headings.should == [heading]
end