Project

General

Profile

Defect #28765 » 0001-unit-test-for-locked-watchers_corrected.patch

Patch with typo corrected - Andreas Deininger, 2018-05-15 14:39

View differences:

test/unit/issue_test.rb
1375 1375
    assert_not_nil copied_closed.closed_on
1376 1376
  end
1377 1377

  
1378
  def test_copy_should_not_copy_locked_watchers
1379
    user = User.find(2)
1380
    user2 = User.find(3)
1381
    issue = Issue.find(8)
1382

  
1383
    Watcher.create!(:user => user, :watchable => issue)
1384
    Watcher.create!(:user => user2, :watchable => issue)
1385

  
1386
    user2.status = User::STATUS_LOCKED
1387
    user2.save!
1388

  
1389
    issue = Issue.new.copy_from(8)
1390

  
1391
    assert issue.save
1392
    assert issue.watched_by?(user)
1393
    assert !issue.watched_by?(user2)
1394
  end
1395

  
1378 1396
  def test_should_not_call_after_project_change_on_creation
1379 1397
    issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1,
1380 1398
                      :subject => 'Test', :author_id => 1)
(3-3/3)