Commit 81bd1e5ce9a08e9ad75fd097a6c935b8b59c982c

Authored by AntonioTerceiro
1 parent 405ce89e

ActionItem132: adding a test for the checkboxes in the view



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1165 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 18 additions and 0 deletions   Show diff stats
test/functional/cms_controller_test.rb
... ... @@ -225,6 +225,24 @@ class CmsControllerTest < Test::Unit::TestCase
225 225 end
226 226 end
227 227  
  228 + should 'display checkboxes for selecting categories' do
  229 + env = Environment.default
  230 + top = env.categories.build(:name => 'Top-Level category'); top.save!
  231 + c1 = env.categories.build(:name => "Test category 1", :parent_id => top.id); c1.save!
  232 + c2 = env.categories.build(:name => "Test category 2", :parent_id => top.id); c2.save!
  233 + c3 = env.categories.build(:name => "Test Category 3", :parent_id => top.id); c3.save!
  234 +
  235 + article = Article.new(:name => 'test')
  236 + article.profile = profile
  237 + article.save!
  238 +
  239 + get :edit, :profile => profile.identifier, :id => article.id
  240 +
  241 + [c1,c2,c3].each do |item|
  242 + assert_tag :tag => 'input', :attributes => { :name => 'article[category_ids][]', :value => item.id}
  243 + end
  244 + end
  245 +
228 246 should 'be able to associate articles with categories' do
229 247  
230 248 env = Environment.default
... ...