##// END OF EJS Templates
scm: space cleanup in unit repository test....
Toshi MARUYAMA -
r5495:18d0618007b5
parent child
Show More
@@ -45,7 +45,7 class RepositoryTest < ActiveSupport::TestCase
45 45 repository.url = "svn://localhost"
46 46 assert repository.save
47 47 repository.reload
48
48
49 49 project = Project.find(3)
50 50 assert_equal repository, project.repository
51 51 end
@@ -72,7 +72,7 class RepositoryTest < ActiveSupport::TestCase
72 72 def test_scan_changesets_for_issue_ids
73 73 Setting.default_language = 'en'
74 74 Setting.notified_events = ['issue_added','issue_updated']
75
75
76 76 # choosing a status to apply to fix issues
77 77 Setting.commit_fix_status_id = IssueStatus.find(:first, :conditions => ["is_closed = ?", true]).id
78 78 Setting.commit_fix_done_ratio = "90"
@@ -80,33 +80,33 class RepositoryTest < ActiveSupport::TestCase
80 80 Setting.commit_fix_keywords = 'fixes , closes'
81 81 Setting.default_language = 'en'
82 82 ActionMailer::Base.deliveries.clear
83
83
84 84 # make sure issue 1 is not already closed
85 85 fixed_issue = Issue.find(1)
86 86 assert !fixed_issue.status.is_closed?
87 87 old_status = fixed_issue.status
88
88
89 89 Repository.scan_changesets_for_issue_ids
90 90 assert_equal [101, 102], Issue.find(3).changeset_ids
91
91
92 92 # fixed issues
93 93 fixed_issue.reload
94 94 assert fixed_issue.status.is_closed?
95 95 assert_equal 90, fixed_issue.done_ratio
96 96 assert_equal [101], fixed_issue.changeset_ids
97
97
98 98 # issue change
99 99 journal = fixed_issue.journals.find(:first, :order => 'created_on desc')
100 100 assert_equal User.find_by_login('dlopper'), journal.user
101 101 assert_equal 'Applied in changeset r2.', journal.notes
102
102
103 103 # 2 email notifications
104 104 assert_equal 2, ActionMailer::Base.deliveries.size
105 105 mail = ActionMailer::Base.deliveries.first
106 106 assert_kind_of TMail::Mail, mail
107 107 assert mail.subject.starts_with?("[#{fixed_issue.project.name} - #{fixed_issue.tracker.name} ##{fixed_issue.id}]")
108 108 assert mail.body.include?("Status changed from #{old_status} to #{fixed_issue.status}")
109
109
110 110 # ignoring commits referencing an issue of another project
111 111 assert_equal [], Issue.find(4).changesets
112 112 end
General Comments 0
You need to be logged in to leave comments. Login now