Project

General

Profile

Defect #26443 » 0001-Add-test-assertions-showcasing-the-issue.patch

Mischa The Evil, 2017-07-14 21:21

View differences:

test/unit/helpers/application_helper_test.rb
282 282
  end
283 283

  
284 284
  def test_redmine_links
285
    user_with_email_login = User.generate!(:login => 'abcd@example.com')
286
    u_wel_id = user_with_email_login.id
287

  
285 288
    issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3},
286 289
                               :class => Issue.find(3).css_classes, :title => 'Bug: Error 281 when updating a recipe (New)')
287 290
    note_link = link_to('#3-14', {:controller => 'issues', :action => 'show', :id => 3, :anchor => 'note-14'},
......
390 393
      '@jsmith'                     => link_to_user(User.find_by_id(2)),
391 394
      # invalid user
392 395
      'user:foobar'                 => 'user:foobar',
396
      #user with email as login
397
      "user##{u_wel_id}"            => link_to_user(User.find_by_id(u_wel_id)),
398
      # The following two (commented-out) assertions fail...
399
      #'user:abcd@example.com'       => link_to_user(User.find_by_id(u_wel_id)),
400
      #'user:"abcd@example.com"'     => link_to_user(User.find_by_id(u_wel_id)),
401
      # The following works though
402
      '@abcd@example.com'           => link_to_user(User.find_by_id(u_wel_id)),
393 403
    }
394 404
    @project = Project.find(1)
395 405
    to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text), "#{text} failed" }
(1-1/2)