From 81bd1e5ce9a08e9ad75fd097a6c935b8b59c982c Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Mon, 31 Dec 2007 17:38:24 +0000 Subject: [PATCH] ActionItem132: adding a test for the checkboxes in the view --- test/functional/cms_controller_test.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+), 0 deletions(-) diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index 6fa62e0..2aee3f9 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -225,6 +225,24 @@ class CmsControllerTest < Test::Unit::TestCase end end + should 'display checkboxes for selecting categories' do + env = Environment.default + top = env.categories.build(:name => 'Top-Level category'); top.save! + c1 = env.categories.build(:name => "Test category 1", :parent_id => top.id); c1.save! + c2 = env.categories.build(:name => "Test category 2", :parent_id => top.id); c2.save! + c3 = env.categories.build(:name => "Test Category 3", :parent_id => top.id); c3.save! + + article = Article.new(:name => 'test') + article.profile = profile + article.save! + + get :edit, :profile => profile.identifier, :id => article.id + + [c1,c2,c3].each do |item| + assert_tag :tag => 'input', :attributes => { :name => 'article[category_ids][]', :value => item.id} + end + end + should 'be able to associate articles with categories' do env = Environment.default -- libgit2 0.21.2