Project

General

Profile

Feature #13946 » rm13946-add-tracker-name-to-issue-link-titles-tests-fixed-trunk@r14471.diff

Mischa The Evil, 2015-07-29 07:03

View differences:

app/helpers/application_helper.rb (working copy)
link = link_to("##{oid}#{comment_suffix}",
issue_url(issue, :only_path => only_path, :anchor => anchor),
:class => issue.css_classes,
:title => "#{issue.subject.truncate(100)} (#{issue.status.name})")
:title => "#{issue.tracker.name}: #{issue.subject.truncate(100)} (#{issue.status.name})")
end
when 'document'
if document = Document.visible.find_by_id(oid)
test/unit/helpers/application_helper_test.rb (working copy)
def test_redmine_links
issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3},
:class => Issue.find(3).css_classes, :title => 'Error 281 when updating a recipe (New)')
:class => Issue.find(3).css_classes, :title => 'Bug: Error 281 when updating a recipe (New)')
note_link = link_to('#3-14', {:controller => 'issues', :action => 'show', :id => 3, :anchor => 'note-14'},
:class => Issue.find(3).css_classes, :title => 'Error 281 when updating a recipe (New)')
:class => Issue.find(3).css_classes, :title => 'Bug: Error 281 when updating a recipe (New)')
note_link2 = link_to('#3#note-14', {:controller => 'issues', :action => 'show', :id => 3, :anchor => 'note-14'},
:class => Issue.find(3).css_classes, :title => 'Error 281 when updating a recipe (New)')
:class => Issue.find(3).css_classes, :title => 'Bug: Error 281 when updating a recipe (New)')
revision_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1},
:class => 'changeset', :title => 'My very first commit do not escaping #<>&')
......
result2 = link_to('#1',
"/issues/1",
:class => Issue.find(1).css_classes,
:title => "Cannot print recipes (New)")
:title => "Bug: Cannot print recipes (New)")
expected = <<-EXPECTED
<p>#{result1}</p>
test/unit/mailer_test.rb (working copy)
# link to a referenced ticket
assert_select 'a[href=?][title=?]',
'https://mydomain.foo/issues/1',
"Cannot print recipes (New)",
"Bug: Cannot print recipes (New)",
:text => '#1'
# link to a changeset
assert_select 'a[href=?][title=?]',
......
# link to a referenced ticket
assert_select 'a[href=?][title=?]',
'http://mydomain.foo/rdm/issues/1',
"Cannot print recipes (New)",
"Bug: Cannot print recipes (New)",
:text => '#1'
# link to a changeset
assert_select 'a[href=?][title=?]',
......
# link to a referenced ticket
assert_select 'a[href=?][title=?]',
'http://mydomain.foo/rdm/issues/1',
"Cannot print recipes (New)",
"Bug: Cannot print recipes (New)",
:text => '#1'
# link to a changeset
assert_select 'a[href=?][title=?]',
(2-2/2)