From 5c8e04db55591fb15e413cda13c3c404b04db5ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Sch=C3=A4fer?= <f.schaefer@finn.de>
Date: Wed, 25 May 2011 16:40:34 +0200
Subject: [PATCH] Fix SearchController tests.

The "dd" the removed assert_tag part was supposed to find should never show up on the page in the first place (it's in a journal, not in the issue itself).
---
 app/models/news.rb                        | 2 +-
 test/functional/search_controller_test.rb | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/models/news.rb b/app/models/news.rb
index 21529050c..6f97e0d12 100644
--- a/app/models/news.rb
+++ b/app/models/news.rb
@@ -25,7 +25,7 @@ class News < ActiveRecord::Base
   validates_length_of :summary, :maximum => 255
 
   acts_as_journalized :event_url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.journaled_id} }
-  acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"], :include => :project
+  acts_as_searchable :columns => ["#{table_name}.title", "#{table_name}.summary", "#{table_name}.description"], :include => :project
   acts_as_watchable
   
   after_create :add_author_as_watcher
diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb
index bcc0b3e8c..52223efef 100644
--- a/test/functional/search_controller_test.rb
+++ b/test/functional/search_controller_test.rb
@@ -36,9 +36,9 @@ class SearchControllerTest < ActionController::TestCase
     assert assigns(:results).include?(Issue.find(2))
     assert assigns(:results).include?(Issue.find(5))
     assert assigns(:results).include?(Changeset.find(101))
-    assert_tag :dt, :attributes => { :class => /issue/ },
-                    :child => { :tag => 'a',  :content => /Add ingredients categories/ },
-                    :sibling => { :tag => 'dd', :content => /A comment with inline image: !picture.jpg!/ }
+    assert_select "dt.issue" do
+      assert_select "a", :text => /Add ingredients categories/
+    end
     
     assert assigns(:results_by_type).is_a?(Hash)
     assert_equal 5, assigns(:results_by_type)['changesets']
-- 
GitLab