annotate test/unit/changeset_test.rb @ 1458:b1f4c9a2af24 bug_794

Makes the default radio button checked by default -- this should fix bug #794.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 11 Nov 2013 18:25:22 +0000
parents 433d4f72a19b
children 622f24f53b42 261b3d9a4903
rev   line source
Chris@0 1 # encoding: utf-8
Chris@0 2 #
Chris@0 3 # Redmine - project management software
Chris@1115 4 # Copyright (C) 2006-2012 Jean-Philippe Lang
Chris@0 5 #
Chris@0 6 # This program is free software; you can redistribute it and/or
Chris@0 7 # modify it under the terms of the GNU General Public License
Chris@0 8 # as published by the Free Software Foundation; either version 2
Chris@0 9 # of the License, or (at your option) any later version.
Chris@909 10 #
Chris@0 11 # This program is distributed in the hope that it will be useful,
Chris@0 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@0 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@0 14 # GNU General Public License for more details.
Chris@909 15 #
Chris@0 16 # You should have received a copy of the GNU General Public License
Chris@0 17 # along with this program; if not, write to the Free Software
Chris@0 18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@0 19
Chris@119 20 require File.expand_path('../../test_helper', __FILE__)
Chris@0 21
Chris@0 22 class ChangesetTest < ActiveSupport::TestCase
Chris@441 23 fixtures :projects, :repositories,
Chris@441 24 :issues, :issue_statuses, :issue_categories,
Chris@909 25 :changesets, :changes,
Chris@441 26 :enumerations,
Chris@441 27 :custom_fields, :custom_values,
Chris@441 28 :users, :members, :member_roles, :trackers,
Chris@441 29 :enabled_modules, :roles
Chris@0 30
Chris@0 31 def test_ref_keywords_any
Chris@0 32 ActionMailer::Base.deliveries.clear
Chris@441 33 Setting.commit_fix_status_id = IssueStatus.find(
Chris@441 34 :first, :conditions => ["is_closed = ?", true]).id
Chris@0 35 Setting.commit_fix_done_ratio = '90'
Chris@0 36 Setting.commit_ref_keywords = '*'
Chris@0 37 Setting.commit_fix_keywords = 'fixes , closes'
Chris@441 38
Chris@441 39 c = Changeset.new(:repository => Project.find(1).repository,
Chris@0 40 :committed_on => Time.now,
Chris@909 41 :comments => 'New commit (#2). Fixes #1',
Chris@909 42 :revision => '12345')
Chris@909 43 assert c.save
Chris@0 44 assert_equal [1, 2], c.issue_ids.sort
Chris@0 45 fixed = Issue.find(1)
Chris@0 46 assert fixed.closed?
Chris@0 47 assert_equal 90, fixed.done_ratio
Chris@0 48 assert_equal 1, ActionMailer::Base.deliveries.size
Chris@0 49 end
Chris@441 50
Chris@119 51 def test_ref_keywords
Chris@119 52 Setting.commit_ref_keywords = 'refs'
Chris@119 53 Setting.commit_fix_keywords = ''
Chris@441 54 c = Changeset.new(:repository => Project.find(1).repository,
Chris@119 55 :committed_on => Time.now,
Chris@909 56 :comments => 'Ignores #2. Refs #1',
Chris@909 57 :revision => '12345')
Chris@909 58 assert c.save
Chris@119 59 assert_equal [1], c.issue_ids.sort
Chris@119 60 end
Chris@441 61
Chris@119 62 def test_ref_keywords_any_only
Chris@119 63 Setting.commit_ref_keywords = '*'
Chris@119 64 Setting.commit_fix_keywords = ''
Chris@441 65 c = Changeset.new(:repository => Project.find(1).repository,
Chris@119 66 :committed_on => Time.now,
Chris@909 67 :comments => 'Ignores #2. Refs #1',
Chris@909 68 :revision => '12345')
Chris@909 69 assert c.save
Chris@119 70 assert_equal [1, 2], c.issue_ids.sort
Chris@119 71 end
Chris@441 72
Chris@119 73 def test_ref_keywords_any_with_timelog
Chris@119 74 Setting.commit_ref_keywords = '*'
Chris@119 75 Setting.commit_logtime_enabled = '1'
Chris@119 76
Chris@245 77 {
Chris@245 78 '2' => 2.0,
Chris@245 79 '2h' => 2.0,
Chris@245 80 '2hours' => 2.0,
Chris@245 81 '15m' => 0.25,
Chris@245 82 '15min' => 0.25,
Chris@245 83 '3h15' => 3.25,
Chris@245 84 '3h15m' => 3.25,
Chris@245 85 '3h15min' => 3.25,
Chris@245 86 '3:15' => 3.25,
Chris@245 87 '3.25' => 3.25,
Chris@245 88 '3.25h' => 3.25,
Chris@245 89 '3,25' => 3.25,
Chris@245 90 '3,25h' => 3.25,
Chris@245 91 }.each do |syntax, expected_hours|
Chris@441 92 c = Changeset.new(:repository => Project.find(1).repository,
Chris@245 93 :committed_on => 24.hours.ago,
Chris@441 94 :comments => "Worked on this issue #1 @#{syntax}",
Chris@441 95 :revision => '520',
Chris@441 96 :user => User.find(2))
Chris@245 97 assert_difference 'TimeEntry.count' do
Chris@245 98 c.scan_comment_for_issue_ids
Chris@245 99 end
Chris@245 100 assert_equal [1], c.issue_ids.sort
Chris@441 101
Chris@245 102 time = TimeEntry.first(:order => 'id desc')
Chris@245 103 assert_equal 1, time.issue_id
Chris@245 104 assert_equal 1, time.project_id
Chris@245 105 assert_equal 2, time.user_id
Chris@441 106 assert_equal expected_hours, time.hours,
Chris@441 107 "@#{syntax} should be logged as #{expected_hours} hours but was #{time.hours}"
Chris@245 108 assert_equal Date.yesterday, time.spent_on
Chris@245 109 assert time.activity.is_default?
Chris@441 110 assert time.comments.include?('r520'),
Chris@441 111 "r520 was expected in time_entry comments: #{time.comments}"
Chris@119 112 end
Chris@119 113 end
Chris@441 114
Chris@119 115 def test_ref_keywords_closing_with_timelog
Chris@441 116 Setting.commit_fix_status_id = IssueStatus.find(
Chris@441 117 :first, :conditions => ["is_closed = ?", true]).id
Chris@119 118 Setting.commit_ref_keywords = '*'
Chris@119 119 Setting.commit_fix_keywords = 'fixes , closes'
Chris@119 120 Setting.commit_logtime_enabled = '1'
Chris@909 121
Chris@441 122 c = Changeset.new(:repository => Project.find(1).repository,
Chris@119 123 :committed_on => Time.now,
Chris@441 124 :comments => 'This is a comment. Fixes #1 @4.5, #2 @1',
Chris@441 125 :user => User.find(2))
Chris@119 126 assert_difference 'TimeEntry.count', 2 do
Chris@119 127 c.scan_comment_for_issue_ids
Chris@119 128 end
Chris@441 129
Chris@119 130 assert_equal [1, 2], c.issue_ids.sort
Chris@119 131 assert Issue.find(1).closed?
Chris@119 132 assert Issue.find(2).closed?
Chris@119 133
Chris@119 134 times = TimeEntry.all(:order => 'id desc', :limit => 2)
Chris@119 135 assert_equal [1, 2], times.collect(&:issue_id).sort
Chris@119 136 end
Chris@441 137
Chris@0 138 def test_ref_keywords_any_line_start
Chris@0 139 Setting.commit_ref_keywords = '*'
Chris@441 140 c = Changeset.new(:repository => Project.find(1).repository,
Chris@0 141 :committed_on => Time.now,
Chris@909 142 :comments => '#1 is the reason of this commit',
Chris@909 143 :revision => '12345')
Chris@909 144 assert c.save
Chris@0 145 assert_equal [1], c.issue_ids.sort
Chris@0 146 end
Chris@0 147
Chris@0 148 def test_ref_keywords_allow_brackets_around_a_issue_number
Chris@0 149 Setting.commit_ref_keywords = '*'
Chris@441 150 c = Changeset.new(:repository => Project.find(1).repository,
Chris@0 151 :committed_on => Time.now,
Chris@909 152 :comments => '[#1] Worked on this issue',
Chris@909 153 :revision => '12345')
Chris@909 154 assert c.save
Chris@0 155 assert_equal [1], c.issue_ids.sort
Chris@0 156 end
Chris@0 157
Chris@0 158 def test_ref_keywords_allow_brackets_around_multiple_issue_numbers
Chris@0 159 Setting.commit_ref_keywords = '*'
Chris@441 160 c = Changeset.new(:repository => Project.find(1).repository,
Chris@0 161 :committed_on => Time.now,
Chris@909 162 :comments => '[#1 #2, #3] Worked on these',
Chris@909 163 :revision => '12345')
Chris@909 164 assert c.save
Chris@0 165 assert_equal [1,2,3], c.issue_ids.sort
Chris@0 166 end
Chris@441 167
Chris@0 168 def test_commit_referencing_a_subproject_issue
Chris@441 169 c = Changeset.new(:repository => Project.find(1).repository,
Chris@0 170 :committed_on => Time.now,
Chris@909 171 :comments => 'refs #5, a subproject issue',
Chris@909 172 :revision => '12345')
Chris@909 173 assert c.save
Chris@0 174 assert_equal [5], c.issue_ids.sort
Chris@0 175 assert c.issues.first.project != c.project
Chris@0 176 end
Chris@0 177
Chris@929 178 def test_commit_closing_a_subproject_issue
Chris@1115 179 with_settings :commit_fix_status_id => 5, :commit_fix_keywords => 'closes',
Chris@1115 180 :default_language => 'en' do
Chris@929 181 issue = Issue.find(5)
Chris@929 182 assert !issue.closed?
Chris@929 183 assert_difference 'Journal.count' do
Chris@929 184 c = Changeset.new(:repository => Project.find(1).repository,
Chris@929 185 :committed_on => Time.now,
Chris@929 186 :comments => 'closes #5, a subproject issue',
Chris@929 187 :revision => '12345')
Chris@929 188 assert c.save
Chris@929 189 end
Chris@929 190 assert issue.reload.closed?
Chris@929 191 journal = Journal.first(:order => 'id DESC')
Chris@929 192 assert_equal issue, journal.issue
Chris@929 193 assert_include "Applied in changeset ecookbook:r12345.", journal.notes
Chris@929 194 end
Chris@929 195 end
Chris@929 196
Chris@0 197 def test_commit_referencing_a_parent_project_issue
Chris@0 198 # repository of child project
Chris@441 199 r = Repository::Subversion.create!(
Chris@441 200 :project => Project.find(3),
Chris@441 201 :url => 'svn://localhost/test')
Chris@441 202 c = Changeset.new(:repository => r,
Chris@0 203 :committed_on => Time.now,
Chris@909 204 :comments => 'refs #2, an issue of a parent project',
Chris@909 205 :revision => '12345')
Chris@909 206 assert c.save
Chris@0 207 assert_equal [2], c.issue_ids.sort
Chris@0 208 assert c.issues.first.project != c.project
Chris@0 209 end
Chris@245 210
Chris@1115 211 def test_commit_referencing_a_project_with_commit_cross_project_ref_disabled
Chris@1115 212 r = Repository::Subversion.create!(
Chris@1115 213 :project => Project.find(3),
Chris@1115 214 :url => 'svn://localhost/test')
Chris@1115 215
Chris@1115 216 with_settings :commit_cross_project_ref => '0' do
Chris@1115 217 c = Changeset.new(:repository => r,
Chris@1115 218 :committed_on => Time.now,
Chris@1115 219 :comments => 'refs #4, an issue of a different project',
Chris@1115 220 :revision => '12345')
Chris@1115 221 assert c.save
Chris@1115 222 assert_equal [], c.issue_ids
Chris@1115 223 end
Chris@1115 224 end
Chris@1115 225
Chris@1115 226 def test_commit_referencing_a_project_with_commit_cross_project_ref_enabled
Chris@1115 227 r = Repository::Subversion.create!(
Chris@1115 228 :project => Project.find(3),
Chris@1115 229 :url => 'svn://localhost/test')
Chris@1115 230
Chris@1115 231 with_settings :commit_cross_project_ref => '1' do
Chris@1115 232 c = Changeset.new(:repository => r,
Chris@1115 233 :committed_on => Time.now,
Chris@1115 234 :comments => 'refs #4, an issue of a different project',
Chris@1115 235 :revision => '12345')
Chris@1115 236 assert c.save
Chris@1115 237 assert_equal [4], c.issue_ids
Chris@1115 238 end
Chris@1115 239 end
Chris@1115 240
Chris@119 241 def test_text_tag_revision
Chris@119 242 c = Changeset.new(:revision => '520')
Chris@119 243 assert_equal 'r520', c.text_tag
Chris@119 244 end
Chris@245 245
Chris@929 246 def test_text_tag_revision_with_same_project
Chris@929 247 c = Changeset.new(:revision => '520', :repository => Project.find(1).repository)
Chris@929 248 assert_equal 'r520', c.text_tag(Project.find(1))
Chris@929 249 end
Chris@929 250
Chris@929 251 def test_text_tag_revision_with_different_project
Chris@929 252 c = Changeset.new(:revision => '520', :repository => Project.find(1).repository)
Chris@929 253 assert_equal 'ecookbook:r520', c.text_tag(Project.find(2))
Chris@929 254 end
Chris@929 255
Chris@1115 256 def test_text_tag_revision_with_repository_identifier
Chris@1115 257 r = Repository::Subversion.create!(
Chris@1115 258 :project_id => 1,
Chris@1115 259 :url => 'svn://localhost/test',
Chris@1115 260 :identifier => 'documents')
Chris@1115 261
Chris@1115 262 c = Changeset.new(:revision => '520', :repository => r)
Chris@1115 263 assert_equal 'documents|r520', c.text_tag
Chris@1115 264 assert_equal 'ecookbook:documents|r520', c.text_tag(Project.find(2))
Chris@1115 265 end
Chris@1115 266
Chris@119 267 def test_text_tag_hash
Chris@441 268 c = Changeset.new(
Chris@441 269 :scmid => '7234cb2750b63f47bff735edc50a1c0a433c2518',
Chris@441 270 :revision => '7234cb2750b63f47bff735edc50a1c0a433c2518')
Chris@119 271 assert_equal 'commit:7234cb2750b63f47bff735edc50a1c0a433c2518', c.text_tag
Chris@119 272 end
Chris@119 273
Chris@929 274 def test_text_tag_hash_with_same_project
Chris@929 275 c = Changeset.new(:revision => '7234cb27', :scmid => '7234cb27', :repository => Project.find(1).repository)
Chris@929 276 assert_equal 'commit:7234cb27', c.text_tag(Project.find(1))
Chris@929 277 end
Chris@929 278
Chris@929 279 def test_text_tag_hash_with_different_project
Chris@929 280 c = Changeset.new(:revision => '7234cb27', :scmid => '7234cb27', :repository => Project.find(1).repository)
Chris@929 281 assert_equal 'ecookbook:commit:7234cb27', c.text_tag(Project.find(2))
Chris@929 282 end
Chris@929 283
Chris@119 284 def test_text_tag_hash_all_number
Chris@119 285 c = Changeset.new(:scmid => '0123456789', :revision => '0123456789')
Chris@119 286 assert_equal 'commit:0123456789', c.text_tag
Chris@119 287 end
Chris@0 288
Chris@0 289 def test_previous
Chris@0 290 changeset = Changeset.find_by_revision('3')
Chris@0 291 assert_equal Changeset.find_by_revision('2'), changeset.previous
Chris@0 292 end
Chris@0 293
Chris@0 294 def test_previous_nil
Chris@0 295 changeset = Changeset.find_by_revision('1')
Chris@0 296 assert_nil changeset.previous
Chris@0 297 end
Chris@0 298
Chris@0 299 def test_next
Chris@0 300 changeset = Changeset.find_by_revision('2')
Chris@0 301 assert_equal Changeset.find_by_revision('3'), changeset.next
Chris@0 302 end
Chris@0 303
Chris@0 304 def test_next_nil
Chris@0 305 changeset = Changeset.find_by_revision('10')
Chris@0 306 assert_nil changeset.next
Chris@0 307 end
Chris@245 308
Chris@0 309 def test_comments_should_be_converted_to_utf8
Chris@441 310 proj = Project.find(3)
Chris@441 311 # str = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt")
Chris@441 312 str = "Texte encod\xe9 en ISO-8859-1."
Chris@441 313 str.force_encoding("ASCII-8BIT") if str.respond_to?(:force_encoding)
Chris@441 314 r = Repository::Bazaar.create!(
Chris@441 315 :project => proj,
Chris@441 316 :url => '/tmp/test/bazaar',
Chris@245 317 :log_encoding => 'ISO-8859-1' )
Chris@441 318 assert r
Chris@441 319 c = Changeset.new(:repository => r,
Chris@441 320 :committed_on => Time.now,
Chris@441 321 :revision => '123',
Chris@441 322 :scmid => '12345',
Chris@441 323 :comments => str)
Chris@441 324 assert( c.save )
Chris@441 325 str_utf8 = "Texte encod\xc3\xa9 en ISO-8859-1."
Chris@441 326 str_utf8.force_encoding("UTF-8") if str_utf8.respond_to?(:force_encoding)
Chris@441 327 assert_equal str_utf8, c.comments
Chris@0 328 end
Chris@245 329
Chris@441 330 def test_invalid_utf8_sequences_in_comments_should_be_replaced_latin1
Chris@441 331 proj = Project.find(3)
Chris@441 332 # str = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt")
Chris@441 333 str1 = "Texte encod\xe9 en ISO-8859-1."
Chris@441 334 str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test"
Chris@441 335 str1.force_encoding("UTF-8") if str1.respond_to?(:force_encoding)
Chris@441 336 str2.force_encoding("ASCII-8BIT") if str2.respond_to?(:force_encoding)
Chris@441 337 r = Repository::Bazaar.create!(
Chris@441 338 :project => proj,
Chris@441 339 :url => '/tmp/test/bazaar',
Chris@245 340 :log_encoding => 'UTF-8' )
Chris@441 341 assert r
Chris@441 342 c = Changeset.new(:repository => r,
Chris@441 343 :committed_on => Time.now,
Chris@441 344 :revision => '123',
Chris@441 345 :scmid => '12345',
Chris@441 346 :comments => str1,
Chris@441 347 :committer => str2)
Chris@441 348 assert( c.save )
Chris@441 349 assert_equal "Texte encod? en ISO-8859-1.", c.comments
Chris@441 350 assert_equal "?a?b?c?d?e test", c.committer
Chris@441 351 end
Chris@441 352
Chris@441 353 def test_invalid_utf8_sequences_in_comments_should_be_replaced_ja_jis
Chris@441 354 proj = Project.find(3)
Chris@441 355 str = "test\xb5\xfetest\xb5\xfe"
Chris@441 356 if str.respond_to?(:force_encoding)
Chris@441 357 str.force_encoding('ASCII-8BIT')
Chris@441 358 end
Chris@441 359 r = Repository::Bazaar.create!(
Chris@441 360 :project => proj,
Chris@441 361 :url => '/tmp/test/bazaar',
Chris@441 362 :log_encoding => 'ISO-2022-JP' )
Chris@441 363 assert r
Chris@441 364 c = Changeset.new(:repository => r,
Chris@441 365 :committed_on => Time.now,
Chris@441 366 :revision => '123',
Chris@441 367 :scmid => '12345',
Chris@441 368 :comments => str)
Chris@441 369 assert( c.save )
Chris@441 370 assert_equal "test??test??", c.comments
Chris@245 371 end
Chris@245 372
Chris@245 373 def test_comments_should_be_converted_all_latin1_to_utf8
Chris@441 374 s1 = "\xC2\x80"
Chris@441 375 s2 = "\xc3\x82\xc2\x80"
Chris@441 376 s4 = s2.dup
Chris@441 377 if s1.respond_to?(:force_encoding)
Chris@441 378 s3 = s1.dup
Chris@441 379 s1.force_encoding('ASCII-8BIT')
Chris@441 380 s2.force_encoding('ASCII-8BIT')
Chris@441 381 s3.force_encoding('ISO-8859-1')
Chris@441 382 s4.force_encoding('UTF-8')
Chris@441 383 assert_equal s3.encode('UTF-8'), s4
Chris@441 384 end
Chris@441 385 proj = Project.find(3)
Chris@441 386 r = Repository::Bazaar.create!(
Chris@441 387 :project => proj,
Chris@441 388 :url => '/tmp/test/bazaar',
Chris@245 389 :log_encoding => 'ISO-8859-1' )
Chris@441 390 assert r
Chris@441 391 c = Changeset.new(:repository => r,
Chris@441 392 :committed_on => Time.now,
Chris@441 393 :revision => '123',
Chris@441 394 :scmid => '12345',
Chris@441 395 :comments => s1)
Chris@441 396 assert( c.save )
Chris@441 397 assert_equal s4, c.comments
Chris@441 398 end
Chris@441 399
Chris@441 400 def test_invalid_utf8_sequences_in_paths_should_be_replaced
Chris@441 401 proj = Project.find(3)
Chris@441 402 str1 = "Texte encod\xe9 en ISO-8859-1"
Chris@441 403 str2 = "\xe9a\xe9b\xe9c\xe9d\xe9e test"
Chris@441 404 str1.force_encoding("UTF-8") if str1.respond_to?(:force_encoding)
Chris@441 405 str2.force_encoding("ASCII-8BIT") if str2.respond_to?(:force_encoding)
Chris@441 406 r = Repository::Bazaar.create!(
Chris@441 407 :project => proj,
Chris@441 408 :url => '/tmp/test/bazaar',
Chris@441 409 :log_encoding => 'UTF-8' )
Chris@441 410 assert r
Chris@441 411 cs = Changeset.new(
Chris@441 412 :repository => r,
Chris@441 413 :committed_on => Time.now,
Chris@441 414 :revision => '123',
Chris@441 415 :scmid => '12345',
Chris@441 416 :comments => "test")
Chris@441 417 assert(cs.save)
Chris@441 418 ch = Change.new(
Chris@441 419 :changeset => cs,
Chris@441 420 :action => "A",
Chris@441 421 :path => str1,
Chris@441 422 :from_path => str2,
Chris@441 423 :from_revision => "345")
Chris@441 424 assert(ch.save)
Chris@441 425 assert_equal "Texte encod? en ISO-8859-1", ch.path
Chris@441 426 assert_equal "?a?b?c?d?e test", ch.from_path
Chris@441 427 end
Chris@441 428
Chris@441 429 def test_comments_nil
Chris@441 430 proj = Project.find(3)
Chris@441 431 r = Repository::Bazaar.create!(
Chris@441 432 :project => proj,
Chris@441 433 :url => '/tmp/test/bazaar',
Chris@441 434 :log_encoding => 'ISO-8859-1' )
Chris@441 435 assert r
Chris@441 436 c = Changeset.new(:repository => r,
Chris@441 437 :committed_on => Time.now,
Chris@441 438 :revision => '123',
Chris@441 439 :scmid => '12345',
Chris@441 440 :comments => nil,
Chris@441 441 :committer => nil)
Chris@441 442 assert( c.save )
Chris@441 443 assert_equal "", c.comments
Chris@441 444 assert_equal nil, c.committer
Chris@441 445 if c.comments.respond_to?(:force_encoding)
Chris@441 446 assert_equal "UTF-8", c.comments.encoding.to_s
Chris@441 447 end
Chris@441 448 end
Chris@441 449
Chris@441 450 def test_comments_empty
Chris@441 451 proj = Project.find(3)
Chris@441 452 r = Repository::Bazaar.create!(
Chris@441 453 :project => proj,
Chris@441 454 :url => '/tmp/test/bazaar',
Chris@441 455 :log_encoding => 'ISO-8859-1' )
Chris@441 456 assert r
Chris@441 457 c = Changeset.new(:repository => r,
Chris@441 458 :committed_on => Time.now,
Chris@441 459 :revision => '123',
Chris@441 460 :scmid => '12345',
Chris@441 461 :comments => "",
Chris@441 462 :committer => "")
Chris@441 463 assert( c.save )
Chris@441 464 assert_equal "", c.comments
Chris@441 465 assert_equal "", c.committer
Chris@441 466 if c.comments.respond_to?(:force_encoding)
Chris@441 467 assert_equal "UTF-8", c.comments.encoding.to_s
Chris@441 468 assert_equal "UTF-8", c.committer.encoding.to_s
Chris@441 469 end
Chris@0 470 end
Chris@119 471
Chris@119 472 def test_identifier
Chris@119 473 c = Changeset.find_by_revision('1')
Chris@119 474 assert_equal c.revision, c.identifier
Chris@119 475 end
Chris@0 476 end