scm: space cleanup in unit repository test.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5615 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-05-02 23:07:38 +00:00
parent 0a132e48f9
commit 18d0618007
1 changed files with 8 additions and 8 deletions

View File

@ -45,7 +45,7 @@ class RepositoryTest < ActiveSupport::TestCase
repository.url = "svn://localhost"
assert repository.save
repository.reload
project = Project.find(3)
assert_equal repository, project.repository
end
@ -72,7 +72,7 @@ class RepositoryTest < ActiveSupport::TestCase
def test_scan_changesets_for_issue_ids
Setting.default_language = 'en'
Setting.notified_events = ['issue_added','issue_updated']
# choosing a status to apply to fix issues
Setting.commit_fix_status_id = IssueStatus.find(:first, :conditions => ["is_closed = ?", true]).id
Setting.commit_fix_done_ratio = "90"
@ -80,33 +80,33 @@ class RepositoryTest < ActiveSupport::TestCase
Setting.commit_fix_keywords = 'fixes , closes'
Setting.default_language = 'en'
ActionMailer::Base.deliveries.clear
# make sure issue 1 is not already closed
fixed_issue = Issue.find(1)
assert !fixed_issue.status.is_closed?
old_status = fixed_issue.status
Repository.scan_changesets_for_issue_ids
assert_equal [101, 102], Issue.find(3).changeset_ids
# fixed issues
fixed_issue.reload
assert fixed_issue.status.is_closed?
assert_equal 90, fixed_issue.done_ratio
assert_equal [101], fixed_issue.changeset_ids
# issue change
journal = fixed_issue.journals.find(:first, :order => 'created_on desc')
assert_equal User.find_by_login('dlopper'), journal.user
assert_equal 'Applied in changeset r2.', journal.notes
# 2 email notifications
assert_equal 2, ActionMailer::Base.deliveries.size
mail = ActionMailer::Base.deliveries.first
assert_kind_of TMail::Mail, mail
assert mail.subject.starts_with?("[#{fixed_issue.project.name} - #{fixed_issue.tracker.name} ##{fixed_issue.id}]")
assert mail.body.include?("Status changed from #{old_status} to #{fixed_issue.status}")
# ignoring commits referencing an issue of another project
assert_equal [], Issue.find(4).changesets
end