@@ -40,7 +40,8 class Issue < ActiveRecord::Base | |||||
40 | # sort by id so that limited eager loading doesn't break with postgresql |
|
40 | # sort by id so that limited eager loading doesn't break with postgresql | |
41 | :order_column => "#{table_name}.id" |
|
41 | :order_column => "#{table_name}.id" | |
42 | acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id}: #{o.subject}"}, |
|
42 | acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id}: #{o.subject}"}, | |
43 |
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}} |
|
43 | :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}}, | |
|
44 | :type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') } | |||
44 |
|
45 | |||
45 | acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]}, |
|
46 | acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]}, | |
46 | :author_key => :author_id |
|
47 | :author_key => :author_id |
@@ -195,6 +195,7 div#activity span.project:after, #search-results span.project:after { content: " | |||||
195 | div#activity dd span.description, #search-results dd span.description { display:block; } |
|
195 | div#activity dd span.description, #search-results dd span.description { display:block; } | |
196 |
|
196 | |||
197 | #search-results dd { margin-bottom: 1em; padding-left: 20px; margin-left:0px; } |
|
197 | #search-results dd { margin-bottom: 1em; padding-left: 20px; margin-left:0px; } | |
|
198 | ||||
198 | div#search-results-counts {float:right;} |
|
199 | div#search-results-counts {float:right;} | |
199 | div#search-results-counts ul { margin-top: 0.5em; } |
|
200 | div#search-results-counts ul { margin-top: 0.5em; } | |
200 | div#search-results-counts li { list-style-type:none; float: left; margin-left: 1em; } |
|
201 | div#search-results-counts li { list-style-type:none; float: left; margin-left: 1em; } | |
@@ -212,6 +213,8 dt.attachment { background-image: url(../images/attachment.png); } | |||||
212 | dt.document { background-image: url(../images/document.png); } |
|
213 | dt.document { background-image: url(../images/document.png); } | |
213 | dt.project { background-image: url(../images/projects.png); } |
|
214 | dt.project { background-image: url(../images/projects.png); } | |
214 |
|
215 | |||
|
216 | #search-results dt.issue.closed { background-image: url(../images/ticket_checked.png); } | |||
|
217 | ||||
215 | div#roadmap fieldset.related-issues { margin-bottom: 1em; } |
|
218 | div#roadmap fieldset.related-issues { margin-bottom: 1em; } | |
216 | div#roadmap fieldset.related-issues ul { margin-top: 0.3em; margin-bottom: 0.3em; } |
|
219 | div#roadmap fieldset.related-issues ul { margin-top: 0.3em; margin-bottom: 0.3em; } | |
217 | div#roadmap .wiki h1:first-child { display: none; } |
|
220 | div#roadmap .wiki h1:first-child { display: none; } |
@@ -108,4 +108,21 issues_007: | |||||
108 | start_date: <%= 10.days.ago.to_s(:db) %> |
|
108 | start_date: <%= 10.days.ago.to_s(:db) %> | |
109 | due_date: <%= Date.today.to_s(:db) %> |
|
109 | due_date: <%= Date.today.to_s(:db) %> | |
110 | lock_version: 0 |
|
110 | lock_version: 0 | |
|
111 | issues_008: | |||
|
112 | created_on: <%= 10.days.ago.to_date.to_s(:db) %> | |||
|
113 | project_id: 1 | |||
|
114 | updated_on: <%= 10.days.ago.to_date.to_s(:db) %> | |||
|
115 | priority_id: 3 | |||
|
116 | subject: Closed issue | |||
|
117 | id: 8 | |||
|
118 | fixed_version_id: | |||
|
119 | category_id: | |||
|
120 | description: This is a closed issue. | |||
|
121 | tracker_id: 1 | |||
|
122 | assigned_to_id: | |||
|
123 | author_id: 2 | |||
|
124 | status_id: 5 | |||
|
125 | start_date: | |||
|
126 | due_date: | |||
|
127 | lock_version: 0 | |||
111 | No newline at end of file |
|
128 |
@@ -45,6 +45,17 class SearchControllerTest < Test::Unit::TestCase | |||||
45 | assert_tag :a, :content => 'Changesets (4)' |
|
45 | assert_tag :a, :content => 'Changesets (4)' | |
46 | end |
|
46 | end | |
47 |
|
47 | |||
|
48 | def test_search_issues | |||
|
49 | get :index, :q => 'issue', :issues => 1 | |||
|
50 | assert_response :success | |||
|
51 | assert_template 'index' | |||
|
52 | ||||
|
53 | assert assigns(:results).include?(Issue.find(8)) | |||
|
54 | assert assigns(:results).include?(Issue.find(5)) | |||
|
55 | assert_tag :dt, :attributes => { :class => /issue closed/ }, | |||
|
56 | :child => { :tag => 'a', :content => /Closed/ } | |||
|
57 | end | |||
|
58 | ||||
48 | def test_search_project_and_subprojects |
|
59 | def test_search_project_and_subprojects | |
49 | get :index, :id => 1, :q => 'recipe subproject', :scope => 'subprojects', :submit => 'Search' |
|
60 | get :index, :id => 1, :q => 'recipe subproject', :scope => 'subprojects', :submit => 'Search' | |
50 | assert_response :success |
|
61 | assert_response :success |
General Comments 0
You need to be logged in to leave comments.
Login now