diff options
author | Go MAEDA <maeda@farend.jp> | 2019-03-19 15:43:55 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-03-19 15:43:55 +0000 |
commit | 26509e7f4c6dae94baf291b95d46eb6ec8ebca0b (patch) | |
tree | eca8843de4ca00c229612e8f4f323a5474444a29 /test/functional/repositories_mercurial_controller_test.rb | |
parent | 7d2f10ccac0e51a8eb337ed388ab8182df4c25e1 (diff) | |
download | redmine-26509e7f4c6dae94baf291b95d46eb6ec8ebca0b.tar.gz redmine-26509e7f4c6dae94baf291b95d46eb6ec8ebca0b.zip |
Decode hexadecimal-encoded literals in order to be frozen string literals friendly (#31004).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@17991 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_mercurial_controller_test.rb')
-rw-r--r-- | test/functional/repositories_mercurial_controller_test.rb | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/test/functional/repositories_mercurial_controller_test.rb b/test/functional/repositories_mercurial_controller_test.rb index a58ba7e3e..1094a1f45 100644 --- a/test/functional/repositories_mercurial_controller_test.rb +++ b/test/functional/repositories_mercurial_controller_test.rb @@ -26,7 +26,6 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest :repositories, :enabled_modules REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s - CHAR_1_HEX = "\xc3\x9c" PRJ_ID = 3 NUM_REV = 34 @@ -43,10 +42,6 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest ) assert @repository @diff_c_support = true - @char_1 = CHAR_1_HEX.dup.force_encoding('UTF-8') - @tag_char_1 = "tag-#{CHAR_1_HEX}-00".force_encoding('UTF-8') - @branch_char_0 = "branch-#{CHAR_1_HEX}-00".force_encoding('UTF-8') - @branch_char_1 = "branch-#{CHAR_1_HEX}-01".force_encoding('UTF-8') end if ruby19_non_utf8_pass @@ -186,9 +181,9 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest assert_select 'table.entries tbody' do assert_select 'tr', 4 assert_select 'tr.file td.filename a', :text => "make-latin-1-file.rb" - assert_select 'tr.file td.filename a', :text => "test-#{@char_1}-1.txt" - assert_select 'tr.file td.filename a', :text => "test-#{@char_1}-2.txt" - assert_select 'tr.file td.filename a', :text => "test-#{@char_1}.txt" + assert_select 'tr.file td.filename a', :text => "test-Ü-1.txt" + assert_select 'tr.file td.filename a', :text => "test-Ü-2.txt" + assert_select 'tr.file td.filename a', :text => "test-Ü.txt" end assert_select 'table.changesets tbody' do @@ -221,9 +216,9 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count [ 'default', - @branch_char_1, + 'branch-Ü-01', 'branch (1)[2]&,%.-3_4', - @branch_char_0, + 'branch-Ü-00', 'test_branch.latin-1', 'test-branch-00', ].each do |bra| @@ -245,7 +240,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest @project.reload assert_equal NUM_REV, @repository.changesets.count [ - @tag_char_1, + 'tag-Ü-00', 'tag_test.00', 'tag-init-revision' ].each do |tag| @@ -287,7 +282,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest get :entry, :params => { :id => PRJ_ID, :repository_id => @repository.id, - :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}-2.txt"])[:param], + :path => repository_path_hash(['latin-1-dir', "test-Ü-2.txt"])[:param], :rev => r1 } assert_response :success @@ -301,11 +296,11 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest get :entry, :params => { :id => PRJ_ID, :repository_id => @repository.id, - :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param], + :path => repository_path_hash(['latin-1-dir', "test-Ü.txt"])[:param], :rev => r1 } assert_response :success - assert_select 'tr#L1 td.line-code', :text => /test-#{@char_1}.txt/ + assert_select 'tr#L1 td.line-code', :text => /test-Ü.txt/ end end end @@ -395,7 +390,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest } assert_response :success assert_select 'table' do - assert_select 'thead th.filename', :text => /latin-1-dir\/test-#{@char_1}-2.txt/ + assert_select 'thead th.filename', :text => /latin-1-dir\/test-Ü-2.txt/ assert_select 'tbody td.diff_in', :text => /It is written in Python/ end end @@ -478,7 +473,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest get :annotate, :params => { :id => PRJ_ID, :repository_id => @repository.id, - :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}-2.txt"])[:param], + :path => repository_path_hash(['latin-1-dir', "test-Ü-2.txt"])[:param], :rev => r1 } assert_response :success @@ -500,10 +495,10 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest get :annotate, :params => { :id => PRJ_ID, :repository_id => @repository.id, - :path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param], + :path => repository_path_hash(['latin-1-dir', "test-Ü.txt"])[:param], :rev => r1 } - assert_select 'tr#L1 td.line-code', :text => /test-#{@char_1}.txt/ + assert_select 'tr#L1 td.line-code', :text => /test-Ü.txt/ end end end |