test fixes

This commit is contained in:
Tim Felgentreff 2010-11-05 11:20:58 +01:00
parent f0cd92c80c
commit 5dda7e34a3
2 changed files with 5 additions and 8 deletions

View File

@ -45,6 +45,7 @@ class Issue < ActiveRecord::Base
register_on_journal_formatter(:fraction, 'estimated_hours')
register_on_journal_formatter(:decimal, 'done_ratio')
register_on_journal_formatter(:datetime, 'due_date', 'start_date')
register_on_journal_formatter(:plaintext, 'subject')
acts_as_searchable :columns => ['subject', "#{table_name}.description", "#{Journal.table_name}.notes"],
:include => [:project, :journals],

View File

@ -683,7 +683,7 @@ class IssuesControllerTest < ActionController::TestCase
assert issue.current_journal.changes.has_key? "subject"
assert issue.current_journal.changes.has_key? "priority_id"
assert !issue.current_journal.changes.has_key?("category_id")
assert issue.current_journal.changes.has_key? 2
assert issue.current_journal.changes.has_key? "custom_values2"
assert_redirected_to :action => 'show', :id => '1'
issue.reload
@ -760,10 +760,6 @@ class IssuesControllerTest < ActionController::TestCase
def test_put_update_with_attachment_only
set_tmp_attachments_directory
# Delete all fixtured journals, a race condition can occur causing the wrong
# journal to get fetched in the next find.
IssueJournal.delete_all
# anonymous user
put :update,
:id => 1,
@ -773,7 +769,7 @@ class IssuesControllerTest < ActionController::TestCase
j = Issue.find(1).last_journal
assert j.notes.blank?
assert_equal 1, j.details.size
assert_equal 'testfile.txt', j.details.first.last
assert_equal 'testfile.txt', j.value(j.details.first)
assert_equal User.anonymous, j.user
mail = ActionMailer::Base.deliveries.last
@ -1021,8 +1017,8 @@ class IssuesControllerTest < ActionController::TestCase
journal = issue.journals.last
assert_equal '777', issue.custom_value_for(2).value
assert_equal 1, journal.details.size
assert_equal '125', journal.details.first.first
assert_equal '777', journal.details.first.last
assert_equal '125', journal.old_value(journal.details.first)
assert_equal '777', journal.value(journal.details.first)
end
def test_bulk_update_unassign