diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-08-25 14:41:55 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-08-25 14:41:55 +0000 |
commit | c754e017dcc49b6c3bdd14ad0fe4553a044b3c73 (patch) | |
tree | f61881ca88b961c3f116a2d443b32741d009b700 /test | |
parent | 138566de0b9bc545ddcdd9492c38c75a61e918f1 (diff) | |
download | redmine-c754e017dcc49b6c3bdd14ad0fe4553a044b3c73.tar.gz redmine-c754e017dcc49b6c3bdd14ad0fe4553a044b3c73.zip |
Changeset comments are now stripped before being stored in the database (patch by Nicholas Wieland).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@657 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/repository_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/repository_test.rb b/test/unit/repository_test.rb index e420b6452..bc2fa626c 100644 --- a/test/unit/repository_test.rb +++ b/test/unit/repository_test.rb @@ -53,4 +53,19 @@ class RepositoryTest < Test::Unit::TestCase # ignoring commits referencing an issue of another project assert_equal [], Issue.find(4).changesets end + + def test_for_changeset_comments_strip + repository = Repository::Mercurial.create( :project => Project.find( 4 ), :url => '/foo/bar/baz' ) + comment = <<-COMMENT + This is a loooooooooooooooooooooooooooong comment + + + COMMENT + changeset = Changeset.new( + :comments => comment, :commit_date => Time.now, :revision => 0, :scmid => 'f39b7922fb3c', + :committer => 'foo <foo@example.com>', :committed_on => Time.now, :repository_id => repository ) + assert( changeset.save ) + assert_not_equal( comment, changeset.comments ) + assert_equal( 'This is a loooooooooooooooooooooooooooong comment', changeset.comments ) + end end |