##// END OF EJS Templates
scm: add compatible "commit:xxx" link test for git and darcs....
Toshi MARUYAMA -
r4570:6a6b68d29515
parent child
Show More
@@ -147,7 +147,7 RAW
147 }
147 }
148 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
148 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
149 end
149 end
150
150
151 def test_redmine_links
151 def test_redmine_links
152 issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3},
152 issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3},
153 :class => 'issue status-1 priority-1 overdue', :title => 'Error 281 when updating a recipe (New)')
153 :class => 'issue status-1 priority-1 overdue', :title => 'Error 281 when updating a recipe (New)')
@@ -224,7 +224,54 RAW
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" }
225 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text), "#{text} failed" }
226 end
226 end
227
227
228 def test_redmine_links_git_commit
229 changeset_link = link_to('abcd',
230 {
231 :controller => 'repositories',
232 :action => 'revision', :id => 'subproject1',
233 :rev => 'abcd'
234 },
235 :class => 'changeset', :title => 'test commit')
236 to_test = {
237 'commit:abcd' => changeset_link,
238 }
239 @project = Project.find(3)
240 r = Repository::Git.create!(:project => @project, :url => '/tmp/test/git')
241 assert r
242 c = Changeset.new(:repository => r,
243 :committed_on => Time.now,
244 :revision => 'abcd',
245 :scmid => 'abcd',
246 :comments => 'test commit')
247 assert( c.save )
248 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
249 end
250
251 # TODO: Bazaar commit id contains mail address, so it contains '@' and '_'.
252 def test_redmine_links_darcs_commit
253 changeset_link = link_to('20080308225258-98289-abcd456efg.gz',
254 {
255 :controller => 'repositories',
256 :action => 'revision', :id => 'subproject1',
257 :rev => '123'
258 },
259 :class => 'changeset', :title => 'test commit')
260 to_test = {
261 'commit:20080308225258-98289-abcd456efg.gz' => changeset_link,
262 }
263 @project = Project.find(3)
264 r = Repository::Darcs.create!(:project => @project, :url => '/tmp/test/darcs')
265 assert r
266 c = Changeset.new(:repository => r,
267 :committed_on => Time.now,
268 :revision => '123',
269 :scmid => '20080308225258-98289-abcd456efg.gz',
270 :comments => 'test commit')
271 assert( c.save )
272 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
273 end
274
228 def test_attachment_links
275 def test_attachment_links
229 attachment_link = link_to('error281.txt', {:controller => 'attachments', :action => 'download', :id => '1'}, :class => 'attachment')
276 attachment_link = link_to('error281.txt', {:controller => 'attachments', :action => 'download', :id => '1'}, :class => 'attachment')
230 to_test = {
277 to_test = {
General Comments 0
You need to be logged in to leave comments. Login now