Mercurial > hg > soundsoftware-site
comparison test/unit/helpers/application_helper_test.rb @ 210:0579821a129a
Update to Redmine trunk rev 4802
author | Chris Cannam |
---|---|
date | Tue, 08 Feb 2011 13:51:46 +0000 |
parents | 8661b858af72 |
children | 051f544170fe |
comparison
equal
deleted
inserted
replaced
128:07fa8a8b56a8 | 210:0579821a129a |
---|---|
198 'source:/some/file.ext#L110' => link_to('source:/some/file.ext#L110', source_url_with_ext.merge(:anchor => 'L110'), :class => 'source'), | 198 'source:/some/file.ext#L110' => link_to('source:/some/file.ext#L110', source_url_with_ext.merge(:anchor => 'L110'), :class => 'source'), |
199 'source:/some/file@52#L110' => link_to('source:/some/file@52#L110', source_url.merge(:rev => 52, :anchor => 'L110'), :class => 'source'), | 199 'source:/some/file@52#L110' => link_to('source:/some/file@52#L110', source_url.merge(:rev => 52, :anchor => 'L110'), :class => 'source'), |
200 'export:/some/file' => link_to('export:/some/file', source_url.merge(:format => 'raw'), :class => 'source download'), | 200 'export:/some/file' => link_to('export:/some/file', source_url.merge(:format => 'raw'), :class => 'source download'), |
201 # message | 201 # message |
202 'message#4' => link_to('Post 2', message_url, :class => 'message'), | 202 'message#4' => link_to('Post 2', message_url, :class => 'message'), |
203 'message#5' => link_to('RE: post 2', message_url.merge(:anchor => 'message-5'), :class => 'message'), | 203 'message#5' => link_to('RE: post 2', message_url.merge(:anchor => 'message-5', :r => 5), :class => 'message'), |
204 # project | 204 # project |
205 'project#3' => link_to('eCookbook Subproject 1', project_url, :class => 'project'), | 205 'project#3' => link_to('eCookbook Subproject 1', project_url, :class => 'project'), |
206 'project:subproject1' => link_to('eCookbook Subproject 1', project_url, :class => 'project'), | 206 'project:subproject1' => link_to('eCookbook Subproject 1', project_url, :class => 'project'), |
207 'project:"eCookbook subProject 1"' => link_to('eCookbook Subproject 1', project_url, :class => 'project'), | 207 'project:"eCookbook subProject 1"' => link_to('eCookbook Subproject 1', project_url, :class => 'project'), |
208 # escaping | 208 # escaping |
220 'source:' => 'source:', | 220 'source:' => 'source:', |
221 # url hash | 221 # url hash |
222 "http://foo.bar/FAQ#3" => '<a class="external" href="http://foo.bar/FAQ#3">http://foo.bar/FAQ#3</a>', | 222 "http://foo.bar/FAQ#3" => '<a class="external" href="http://foo.bar/FAQ#3">http://foo.bar/FAQ#3</a>', |
223 } | 223 } |
224 @project = Project.find(1) | 224 @project = Project.find(1) |
225 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text), "#{text} failed" } | |
226 end | |
227 | |
228 def test_cross_project_redmine_links | |
229 source_link = link_to('ecookbook:source:/some/file', {:controller => 'repositories', :action => 'entry', :id => 'ecookbook', :path => ['some', 'file']}, | |
230 :class => 'source') | |
231 | |
232 changeset_link = link_to('ecookbook:r2', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 2}, | |
233 :class => 'changeset', :title => 'This commit fixes #1, #2 and references #1 & #3') | |
234 | |
235 to_test = { | |
236 # documents | |
237 'document:"Test document"' => 'document:"Test document"', | |
238 'ecookbook:document:"Test document"' => '<a href="/documents/1" class="document">Test document</a>', | |
239 'invalid:document:"Test document"' => 'invalid:document:"Test document"', | |
240 # versions | |
241 'version:"1.0"' => 'version:"1.0"', | |
242 'ecookbook:version:"1.0"' => '<a href="/versions/show/2" class="version">1.0</a>', | |
243 'invalid:version:"1.0"' => 'invalid:version:"1.0"', | |
244 # changeset | |
245 'r2' => 'r2', | |
246 'ecookbook:r2' => changeset_link, | |
247 'invalid:r2' => 'invalid:r2', | |
248 # source | |
249 'source:/some/file' => 'source:/some/file', | |
250 'ecookbook:source:/some/file' => source_link, | |
251 'invalid:source:/some/file' => 'invalid:source:/some/file', | |
252 } | |
253 @project = Project.find(3) | |
225 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text), "#{text} failed" } | 254 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text), "#{text} failed" } |
226 end | 255 end |
227 | 256 |
228 def test_redmine_links_git_commit | 257 def test_redmine_links_git_commit |
229 changeset_link = link_to('abcd', | 258 changeset_link = link_to('abcd', |