Show long text custom field changes as a diff (#15236).

git-svn-id: http://svn.redmine.org/redmine/trunk@13954 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2015-01-31 10:42:41 +00:00
parent defd3f439f
commit e11f77a4b0
5 changed files with 65 additions and 7 deletions

View File

@@ -203,12 +203,25 @@ class IssuesHelperTest < ActionView::TestCase
assert_match '6.30', show_detail(detail, true)
end
test 'show_detail should not show values with a description attribute' do
detail = JournalDetail.new(:property => 'attr', :prop_key => 'description',
:old_value => 'Foo', :value => 'Bar')
assert_equal 'Description updated', show_detail(detail, true)
end
test 'show_detail should show old and new values with a custom field' do
detail = JournalDetail.new(:property => 'cf', :prop_key => '1',
:old_value => 'MySQL', :value => 'PostgreSQL')
assert_equal 'Database changed from MySQL to PostgreSQL', show_detail(detail, true)
end
test 'show_detail should not show values with a long text custom field' do
field = IssueCustomField.create!(:name => "Long field", :field_format => 'text')
detail = JournalDetail.new(:property => 'cf', :prop_key => field.id,
:old_value => 'Foo', :value => 'Bar')
assert_equal 'Long field updated', show_detail(detail, true)
end
test 'show_detail should show added file' do
detail = JournalDetail.new(:property => 'attachment', :prop_key => '1',
:old_value => nil, :value => 'error281.txt')