@question.strip!
@all_words = params[:all_words] || (params[:submit] ? false : true)
+ offset = nil
+ begin; offset = params[:offset].to_time if params[:offset]; rescue; end
+
# quick jump to an issue
if @question.match(/^#?(\d+)$/) && Issue.find_by_id($1, :include => :project, :conditions => Project.visible_by(logged_in_user))
redirect_to :controller => "issues", :action => "show", :id => $1
end
if @project
- @object_types = %w(projects issues changesets news documents wiki_pages messages)
- @object_types.delete('wiki_pages') unless @project.wiki
- @object_types.delete('changesets') unless @project.repository
# only show what the user is allowed to view
+ @object_types = %w(issues news documents changesets wiki_pages messages)
@object_types = @object_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, @project)}
@scope = @object_types.select {|t| params[t]}
- # default objects to search if none is specified in parameters
@scope = @object_types if @scope.empty?
else
@object_types = @scope = %w(projects)
# strings used in sql like statement
like_tokens = @tokens.collect {|w| "%#{w.downcase}%"}
operator = @all_words ? " AND " : " OR "
- limit = 10
@results = []
+ limit = 10
if @project
- @results += @project.issues.find(:all, :limit => limit, :include => :author, :conditions => [ (["(LOWER(subject) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'issues'
- Journal.with_scope :find => {:conditions => ["#{Issue.table_name}.project_id = ?", @project.id]} do
- @results += Journal.find(:all, :include => :issue, :limit => limit, :conditions => [ (["(LOWER(notes) like ? OR LOWER(notes) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ).collect(&:issue) if @scope.include? 'issues'
+ @scope.each do |s|
+ @results += s.singularize.camelcase.constantize.search(like_tokens, @all_words, @project,
+ :limit => (limit+1), :offset => offset, :before => params[:previous].nil?)
end
- @results.uniq!
- @results += @project.news.find(:all, :limit => limit, :conditions => [ (["(LOWER(title) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort], :include => :author ) if @scope.include? 'news'
- @results += @project.documents.find(:all, :limit => limit, :conditions => [ (["(LOWER(title) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'documents'
- @results += @project.wiki.pages.find(:all, :limit => limit, :include => :content, :conditions => [ (["(LOWER(title) like ? OR LOWER(text) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @project.wiki && @scope.include?('wiki_pages')
- @results += @project.repository.changesets.find(:all, :limit => limit, :conditions => [ (["(LOWER(comments) like ?)"] * like_tokens.size).join(operator), * (like_tokens).sort] ) if @project.repository && @scope.include?('changesets')
- Message.with_scope :find => {:conditions => ["#{Board.table_name}.project_id = ?", @project.id]} do
- @results += Message.find(:all, :include => :board, :limit => limit, :conditions => [ (["(LOWER(subject) like ? OR LOWER(content) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'messages'
+ @results = @results.sort {|a,b| b.event_datetime <=> a.event_datetime}
+ if params[:previous].nil?
+ @pagination_previous_date = @results[0].event_datetime if offset && @results[0]
+ if @results.size > limit
+ @pagination_next_date = @results[limit-1].event_datetime
+ @results = @results[0, limit]
+ end
+ else
+ @pagination_next_date = @results[-1].event_datetime if offset && @results[-1]
+ if @results.size > limit
+ @pagination_previous_date = @results[-(limit)].event_datetime
+ @results = @results[-(limit), limit]
+ end
end
else
Project.with_scope(:find => {:conditions => Project.visible_by(logged_in_user)}) do
else
@question = ""
end
+ render :layout => false if request.xhr?
end
private
module SearchHelper
def highlight_tokens(text, tokens)
- return text unless tokens && !tokens.empty?
+ return text unless text && tokens && !tokens.empty?
regexp = Regexp.new "(#{tokens.join('|')})", Regexp::IGNORECASE
result = ''
text.split(regexp).each_with_index do |words, i|
:datetime => :committed_on,
:author => :committer,
:url => Proc.new {|o| {:controller => 'repositories', :action => 'revision', :id => o.repository.project_id, :rev => o.revision}}
+
+ acts_as_searchable :columns => 'comments',
+ :include => :repository,
+ :project_key => "#{Repository.table_name}.project_id",
+ :date_column => 'committed_on'
validates_presence_of :repository_id, :revision, :committed_on, :commit_date
validates_numericality_of :revision, :only_integer => true
belongs_to :category, :class_name => "Enumeration", :foreign_key => "category_id"
has_many :attachments, :as => :container, :dependent => :destroy
- acts_as_event :url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.id}}
+ acts_as_searchable :columns => ['title', 'description']
+ acts_as_event :title => Proc.new {|o| "#{l(:label_document)}: #{o.title}"},
+ :url => Proc.new {|o| {:controller => 'documents', :action => 'show', :id => o.id}}
validates_presence_of :project, :title, :category
validates_length_of :title, :maximum => 60
has_many :relations_to, :class_name => 'IssueRelation', :foreign_key => 'issue_to_id', :dependent => :delete_all
acts_as_watchable
+ acts_as_searchable :columns => ['subject', 'description'], :with => {:journal => :issue}
acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id}: #{o.subject}"},
- :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}}
+ :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}}
validates_presence_of :subject, :description, :priority, :tracker, :author, :status
validates_length_of :subject, :maximum => 255
belongs_to :user
has_many :details, :class_name => "JournalDetail", :dependent => :delete_all
+
+ acts_as_searchable :columns => 'notes',
+ :include => :issue,
+ :project_key => "#{Issue.table_name}.project_id",
+ :date_column => "#{Issue.table_name}.created_on"
end
has_many :attachments, :as => :container, :dependent => :destroy
belongs_to :last_reply, :class_name => 'Message', :foreign_key => 'last_reply_id'
+ acts_as_searchable :columns => ['subject', 'content'], :include => :board, :project_key => "project_id"
+ acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"},
+ :description => :content,
+ :url => Proc.new {|o| {:controller => 'messages', :action => 'show', :board_id => o.board_id, :id => o.id}}
+
validates_presence_of :subject, :content
validates_length_of :subject, :maximum => 255
validates_length_of :title, :maximum => 60
validates_length_of :summary, :maximum => 255
+ acts_as_searchable :columns => ['title', 'description']
acts_as_event :url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.id}}
# returns latest news for projects visible by user
has_one :wiki, :dependent => :destroy
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
acts_as_tree :order => "name", :counter_cache => true
-
+
+ acts_as_searchable :columns => ['name', 'description'], :project_key => 'id'
+ acts_as_event :title => Proc.new {|o| "#{l(:label_project)}: #{o.name}"},
+ :url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}}
+
attr_protected :status, :enabled_module_names
validates_presence_of :name, :description, :identifier
belongs_to :wiki
has_one :content, :class_name => 'WikiContent', :foreign_key => 'page_id', :dependent => :destroy
has_many :attachments, :as => :container, :dependent => :destroy
-
+
+ acts_as_event :title => Proc.new {|o| "#{l(:label_wiki)}: #{o.title}"},
+ :description => :text,
+ :datetime => :created_on,
+ :url => Proc.new {|o| {:controller => 'wiki', :id => o.wiki.project_id, :page => o.title}}
+
+ acts_as_searchable :columns => ['title', 'text'],
+ :include => [:wiki, :content],
+ :project_key => "#{Wiki.table_name}.project_id"
+
attr_accessor :redirect_existing_links
validates_presence_of :title
def project
wiki.project
end
+
+ def text
+ content.text if content
+ end
end
class WikiDiff
</div>\r
\r
<% if @results %>\r
- <h3><%= lwr(:label_result, @results.length) %></h3>\r
+ <h3><%= l(:label_result_plural) %></h3>\r
<ul>\r
<% @results.each do |e| %>\r
- <li><p>\r
- <% if e.is_a? Project %>\r
- <%= link_to highlight_tokens(h(e.name), @tokens), :controller => 'projects', :action => 'show', :id => e %><br />\r
- <%= highlight_tokens(e.description, @tokens) %>\r
- <% elsif e.is_a? Issue %>\r
- <%= link_to_issue e %>: <%= highlight_tokens(h(e.subject), @tokens) %><br />\r
- <%= highlight_tokens(e.description, @tokens) %><br />\r
- <i><%= e.author.name %>, <%= format_time(e.created_on) %></i>\r
- <% elsif e.is_a? News %>\r
- <%=l(:label_news)%>: <%= link_to highlight_tokens(h(e.title), @tokens), :controller => 'news', :action => 'show', :id => e %><br />\r
- <%= highlight_tokens(e.description, @tokens) %><br />\r
- <i><%= e.author.name %>, <%= format_time(e.created_on) %></i>\r
- <% elsif e.is_a? Document %>\r
- <%=l(:label_document)%>: <%= link_to highlight_tokens(h(e.title), @tokens), :controller => 'documents', :action => 'show', :id => e %><br />\r
- <%= highlight_tokens(e.description, @tokens) %><br />\r
- <i><%= format_time(e.created_on) %></i>\r
- <% elsif e.is_a? WikiPage %>\r
- <%=l(:label_wiki)%>: <%= link_to highlight_tokens(h(e.pretty_title), @tokens), :controller => 'wiki', :action => 'index', :id => @project, :page => e.title %><br />\r
- <%= highlight_tokens(e.content.text, @tokens) %><br />\r
- <i><%= e.content.author ? e.content.author.name : "Anonymous" %>, <%= format_time(e.content.updated_on) %></i>\r
- <% elsif e.is_a? Changeset %>\r
- <%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br />\r
- <%= highlight_tokens(e.comments, @tokens) %><br />\r
- <em><%= e.committer.blank? ? e.committer : "Anonymous" %>, <%= format_time(e.committed_on) %></em>\r
- <% elsif e.is_a? Message %>\r
- <%=h e.board.name %>: <%= link_to_message e %><br />\r
- <%= highlight_tokens(e.content, @tokens) %><br />\r
- <em><%= e.author ? e.author.name : "Anonymous" %>, <%= format_time(e.created_on) %></em>\r
- <% end %>\r
- </p></li> \r
+ <li><p><%= link_to highlight_tokens(truncate(e.event_title, 255), @tokens), e.event_url %><br />\r
+ <%= highlight_tokens(e.event_description, @tokens) %><br />\r
+ <span class="author"><%= format_time(e.event_datetime) %></span></p></li>\r
<% end %>\r
</ul>\r
<% end %>\r
+\r
+<p><center>\r
+<% if @pagination_previous_date %>\r
+<%= link_to_remote ('« ' + l(:label_previous)),\r
+ {:update => :content,\r
+ :url => params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))\r
+ }, :href => url_for(params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))) %> \r
+<% end %>\r
+<% if @pagination_next_date %>\r
+<%= link_to_remote (l(:label_next) + ' »'),\r
+ {:update => :content,\r
+ :url => params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))\r
+ }, :href => url_for(params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))) %>\r
+<% end %>\r
+</center></p>\r
# Add additional load paths for sweepers
config.load_paths += %W( #{RAILS_ROOT}/app/sweepers )
+
+ config.plugin_paths = ['lib/plugins', 'vendor/plugins']
# Force all environments to use the same logger level
# (by default production uses :info, the others :debug)
label_roadmap_overdue: %s late
label_roadmap_no_issues: No issues for this version
label_search: Search
-label_result: %d result
-label_result_plural: %d results
+label_result_plural: Results
label_all_words: All words
label_wiki: Wiki
label_wiki_edit: Wiki edit
label_roadmap_overdue: En retard de %s
label_roadmap_no_issues: Aucune demande pour cette version
label_search: Recherche
-label_result: %d résultat
-label_result_plural: %d résultats
+label_result_plural: Résultats
label_all_words: Tous les mots
label_wiki: Wiki
label_wiki_edit: Révision wiki
--- /dev/null
+require File.dirname(__FILE__) + '/lib/acts_as_event'
+ActiveRecord::Base.send(:include, Redmine::Acts::Event)
--- /dev/null
+# redMine - project management software
+# Copyright (C) 2006-2007 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+module Redmine
+ module Acts
+ module Event
+ def self.included(base)
+ base.extend ClassMethods
+ end
+
+ module ClassMethods
+ def acts_as_event(options = {})
+ return if self.included_modules.include?(Redmine::Acts::Event::InstanceMethods)
+ options[:datetime] ||= 'created_on'
+ options[:title] ||= 'title'
+ options[:description] ||= 'description'
+ options[:author] ||= 'author'
+ options[:url] ||= {:controller => 'welcome'}
+ cattr_accessor :event_options
+ self.event_options = options
+ send :include, Redmine::Acts::Event::InstanceMethods
+ end
+ end
+
+ module InstanceMethods
+ def self.included(base)
+ base.extend ClassMethods
+ end
+
+ %w(datetime title description author).each do |attr|
+ src = <<-END_SRC
+ def event_#{attr}
+ option = event_options[:#{attr}]
+ option.is_a?(Proc) ? option.call(self) : send(option)
+ end
+ END_SRC
+ class_eval src, __FILE__, __LINE__
+ end
+
+ def event_date
+ event_datetime.to_date
+ end
+
+ def event_url(options = {})
+ option = event_options[:url]
+ (option.is_a?(Proc) ? option.call(self) : send(option)).merge(options)
+ end
+
+ module ClassMethods
+ end
+ end
+ end
+ end
+end
--- /dev/null
+require File.dirname(__FILE__) + '/lib/acts_as_searchable'
+ActiveRecord::Base.send(:include, Redmine::Acts::Searchable)
--- /dev/null
+# redMine - project management software
+# Copyright (C) 2006-2007 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+module Redmine
+ module Acts
+ module Searchable
+ def self.included(base)
+ base.extend ClassMethods
+ end
+
+ module ClassMethods
+ def acts_as_searchable(options = {})
+ return if self.included_modules.include?(Redmine::Acts::Searchable::InstanceMethods)
+
+ cattr_accessor :searchable_options
+ self.searchable_options = options
+
+ if searchable_options[:columns].nil?
+ raise 'No searchable column defined.'
+ elsif !searchable_options[:columns].is_a?(Array)
+ searchable_options[:columns] = [] << searchable_options[:columns]
+ end
+
+ if searchable_options[:project_key]
+ elsif column_names.include?('project_id')
+ searchable_options[:project_key] = "#{table_name}.project_id"
+ else
+ raise 'No project key defined.'
+ end
+
+ if searchable_options[:date_column]
+ elsif column_names.include?('created_on')
+ searchable_options[:date_column] = "#{table_name}.created_on"
+ else
+ raise 'No date column defined defined.'
+ end
+
+ send :include, Redmine::Acts::Searchable::InstanceMethods
+ end
+ end
+
+ module InstanceMethods
+ def self.included(base)
+ base.extend ClassMethods
+ end
+
+ module ClassMethods
+ def search(tokens, all_tokens, project, options={})
+ tokens = [] << tokens unless tokens.is_a?(Array)
+ find_options = {:include => searchable_options[:include]}
+ find_options[:limit] = options[:limit] if options[:limit]
+ find_options[:order] = "#{searchable_options[:date_column]} " + (options[:before] ? 'DESC' : 'ASC')
+
+ sql = ([ '(' + searchable_options[:columns].collect {|column| "(LOWER(#{column}) LIKE ?)"}.join(' OR ') + ')' ] * tokens.size).join(all_tokens ? ' AND ' : ' OR ')
+ if options[:offset]
+ sql = "(#{sql}) AND (#{searchable_options[:date_column]} " + (options[:before] ? '<' : '>') + "'#{connection.quoted_date(options[:offset])}')"
+ end
+ find_options[:conditions] = [sql, * (tokens * searchable_options[:columns].size).sort]
+
+ results = with_scope(:find => {:conditions => ["#{searchable_options[:project_key]} = ?", project.id]}) do
+ find(:all, find_options)
+ end
+ if searchable_options[:with]
+ searchable_options[:with].each do |model, assoc|
+ results += model.to_s.camelcase.constantize.search(tokens, all_tokens, project, options).collect {|r| r.send assoc}
+ end
+ results.uniq!
+ end
+ results
+ end
+ end
+ end
+ end
+ end
+end
--- /dev/null
+# Include hook code here
+require File.dirname(__FILE__) + '/lib/acts_as_watchable'
+ActiveRecord::Base.send(:include, Redmine::Acts::Watchable)
--- /dev/null
+# ActsAsWatchable
+module Redmine
+ module Acts
+ module Watchable
+ def self.included(base)
+ base.extend ClassMethods
+ end
+
+ module ClassMethods
+ def acts_as_watchable(options = {})
+ return if self.included_modules.include?(Redmine::Acts::Watchable::InstanceMethods)
+ send :include, Redmine::Acts::Watchable::InstanceMethods
+
+ class_eval do
+ has_many :watchers, :as => :watchable, :dependent => :delete_all
+ end
+ end
+ end
+
+ module InstanceMethods
+ def self.included(base)
+ base.extend ClassMethods
+ end
+
+ def add_watcher(user)
+ self.watchers << Watcher.new(:user => user)
+ end
+
+ def remove_watcher(user)
+ return nil unless user && user.is_a?(User)
+ Watcher.delete_all "watchable_type = '#{self.class}' AND watchable_id = #{self.id} AND user_id = #{user.id}"
+ end
+
+ def watched_by?(user)
+ !self.watchers.find(:first,
+ :conditions => ["#{Watcher.table_name}.user_id = ?", user.id]).nil?
+ end
+
+ def watcher_recipients
+ self.watchers.collect { |w| w.user.mail }
+ end
+
+ module ClassMethods
+ def watched_by(user)
+ find(:all,
+ :include => :watchers,
+ :conditions => ["#{Watcher.table_name}.user_id = ?", user.id])
+ end
+ end
+ end
+ end
+ end
+end
\ No newline at end of file
require 'redmine/access_control'
require 'redmine/menu_manager'
require 'redmine/mime_type'
-require 'redmine/acts_as_watchable/init'
-require 'redmine/acts_as_event/init'
require 'redmine/plugin'
begin
+++ /dev/null
-require File.dirname(__FILE__) + '/lib/acts_as_event'
-ActiveRecord::Base.send(:include, Redmine::Acts::Event)
+++ /dev/null
-# redMine - project management software
-# Copyright (C) 2006-2007 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-module Redmine
- module Acts
- module Event
- def self.included(base)
- base.extend ClassMethods
- end
-
- module ClassMethods
- def acts_as_event(options = {})
- return if self.included_modules.include?(Redmine::Acts::Event::InstanceMethods)
- options[:datetime] ||= 'created_on'
- options[:title] ||= 'title'
- options[:description] ||= 'description'
- options[:author] ||= 'author'
- options[:url] ||= {:controller => 'welcome'}
- cattr_accessor :event_options
- self.event_options = options
- send :include, Redmine::Acts::Event::InstanceMethods
- end
- end
-
- module InstanceMethods
- def self.included(base)
- base.extend ClassMethods
- end
-
- %w(datetime title description author).each do |attr|
- src = <<-END_SRC
- def event_#{attr}
- option = event_options[:#{attr}]
- option.is_a?(Proc) ? option.call(self) : send(option)
- end
- END_SRC
- class_eval src, __FILE__, __LINE__
- end
-
- def event_date
- event_datetime.to_date
- end
-
- def event_url(options = {})
- option = event_options[:url]
- (option.is_a?(Proc) ? option.call(self) : send(option)).merge(options)
- end
-
- module ClassMethods
- end
- end
- end
- end
-end
+++ /dev/null
-# Include hook code here
-require File.dirname(__FILE__) + '/lib/acts_as_watchable'
-ActiveRecord::Base.send(:include, Redmine::Acts::Watchable)
+++ /dev/null
-# ActsAsWatchable
-module Redmine
- module Acts
- module Watchable
- def self.included(base)
- base.extend ClassMethods
- end
-
- module ClassMethods
- def acts_as_watchable(options = {})
- return if self.included_modules.include?(Redmine::Acts::Watchable::InstanceMethods)
- send :include, Redmine::Acts::Watchable::InstanceMethods
-
- class_eval do
- has_many :watchers, :as => :watchable, :dependent => :delete_all
- end
- end
- end
-
- module InstanceMethods
- def self.included(base)
- base.extend ClassMethods
- end
-
- def add_watcher(user)
- self.watchers << Watcher.new(:user => user)
- end
-
- def remove_watcher(user)
- return nil unless user && user.is_a?(User)
- Watcher.delete_all "watchable_type = '#{self.class}' AND watchable_id = #{self.id} AND user_id = #{user.id}"
- end
-
- def watched_by?(user)
- !self.watchers.find(:first,
- :conditions => ["#{Watcher.table_name}.user_id = ?", user.id]).nil?
- end
-
- def watcher_recipients
- self.watchers.collect { |w| w.user.mail }
- end
-
- module ClassMethods
- def watched_by(user)
- find(:all,
- :include => :watchers,
- :conditions => ["#{Watcher.table_name}.user_id = ?", user.id])
- end
- end
- end
- end
- end
-end
\ No newline at end of file
assert_template 'index'
assert_not_nil assigns(:project)
- get :index, :id => 1, :q => "can", :scope => ["issues", "news", "documents"]
+ get :index, :id => 1, :q => "can"
assert_response :success
assert_template 'index'
end