comparison test/functional/repositories_mercurial_controller_test.rb @ 1464:261b3d9a4903 redmine-2.4

Update to Redmine 2.4 branch rev 12663
author Chris Cannam
date Tue, 14 Jan 2014 14:37:42 +0000
parents 433d4f72a19b
children e248c7af89ec
comparison
equal deleted inserted replaced
1296:038ba2d95de8 1464:261b3d9a4903
1 # Redmine - project management software 1 # Redmine - project management software
2 # Copyright (C) 2006-2012 Jean-Philippe Lang 2 # Copyright (C) 2006-2013 Jean-Philippe Lang
3 # 3 #
4 # This program is free software; you can redistribute it and/or 4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License 5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2 6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. 7 # of the License, or (at your option) any later version.
430 get :annotate, :id => PRJ_ID, 430 get :annotate, :id => PRJ_ID,
431 :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}-2.txt"])[:param], 431 :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}-2.txt"])[:param],
432 :rev => r1 432 :rev => r1
433 assert_response :success 433 assert_response :success
434 assert_template 'annotate' 434 assert_template 'annotate'
435 assert_tag :tag => 'th', 435 assert_select "th.line-num", :text => '1' do
436 :content => '1', 436 assert_select "+ td.revision" do
437 :attributes => { :class => 'line-num' }, 437 assert_select "a", :text => '20:709858aafd1b'
438 :sibling => 438 assert_select "+ td.author", :text => "jsmith" do
439 { 439 assert_select "+ td",
440 :tag => 'td', 440 :text => "Mercurial is a distributed version control system."
441 :attributes => { :class => 'revision' }, 441 end
442 :child => { :tag => 'a', :content => '20:709858aafd1b' } 442 end
443 } 443 end
444 assert_tag :tag => 'th',
445 :content => '1',
446 :attributes => { :class => 'line-num' },
447 :sibling =>
448 {
449 :tag => 'td' ,
450 :content => 'jsmith' ,
451 :attributes => { :class => 'author' },
452 }
453 assert_tag :tag => 'th',
454 :content => '1',
455 :attributes => { :class => 'line-num' },
456 :sibling => { :tag => 'td',
457 :content => /Mercurial is a distributed version control system/ }
458
459 end 444 end
460 end 445 end
461 446
462 def test_annotate_latin_1_contents 447 def test_annotate_latin_1_contents
463 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do 448 with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
472 :content => /test-#{@char_1}.txt/ } 457 :content => /test-#{@char_1}.txt/ }
473 end 458 end
474 end 459 end
475 end 460 end
476 461
462 def test_revision
463 assert_equal 0, @repository.changesets.count
464 @repository.fetch_changesets
465 @project.reload
466 assert_equal NUM_REV, @repository.changesets.count
467 ['1', '9d5b5b', '9d5b5b004199'].each do |r|
468 with_settings :default_language => "en" do
469 get :revision, :id => PRJ_ID, :rev => r
470 assert_response :success
471 assert_template 'revision'
472 assert_select 'title',
473 :text => 'Revision 1:9d5b5b004199 - Added 2 files and modified one. - eCookbook Subproject 1 - Redmine'
474 end
475 end
476 end
477
477 def test_empty_revision 478 def test_empty_revision
478 assert_equal 0, @repository.changesets.count 479 assert_equal 0, @repository.changesets.count
479 @repository.fetch_changesets 480 @repository.fetch_changesets
480 @project.reload 481 @project.reload
481 assert_equal NUM_REV, @repository.changesets.count 482 assert_equal NUM_REV, @repository.changesets.count