diff options
author | Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com> | 2011-06-13 22:09:01 +0000 |
---|---|---|
committer | Jean-Baptiste Barth <jeanbaptiste.barth@gmail.com> | 2011-06-13 22:09:01 +0000 |
commit | 115d22729848c84bd669e4a5017c360a620213a6 (patch) | |
tree | 9281e6a1d106d4046e93b812aead2a8c905a76ad /test/functional/repositories_git_controller_test.rb | |
parent | 22de20fe61e8879b1aa069406dd0f3bd63ba407c (diff) | |
download | redmine-115d22729848c84bd669e4a5017c360a620213a6.tar.gz redmine-115d22729848c84bd669e4a5017c360a620213a6.zip |
Do not cache I18n strings when truncating a long diff (#5089).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6073 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_git_controller_test.rb')
-rw-r--r-- | test/functional/repositories_git_controller_test.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb index 06e2428d4..0ea9a6621 100644 --- a/test/functional/repositories_git_controller_test.rb +++ b/test/functional/repositories_git_controller_test.rb @@ -56,6 +56,8 @@ class RepositoriesGitControllerTest < ActionController::TestCase if @char_1.respond_to?(:force_encoding) @char_1.force_encoding('UTF-8') end + + Setting.default_language = 'en' end if File.directory?(REPOSITORY_PATH) @@ -219,6 +221,27 @@ class RepositoriesGitControllerTest < ActionController::TestCase end end + def test_diff_truncated + @repository.fetch_changesets + @repository.reload + Setting.diff_max_lines_displayed = 5 + + # Truncated diff of changeset 2f9c0091 + with_cache do + get :diff, :id => PRJ_ID, :type => 'inline', + :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7' + assert_response :success + assert @response.body.include?("... This diff was truncated") + + Setting.default_language = 'fr' + get :diff, :id => PRJ_ID, :type => 'inline', + :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7' + assert_response :success + assert ! @response.body.include?("... This diff was truncated") + assert @response.body.include?("... Ce diff") + end + end + def test_diff_two_revs @repository.fetch_changesets @repository.reload @@ -361,4 +384,12 @@ class RepositoriesGitControllerTest < ActionController::TestCase puts "Git test repository NOT FOUND. Skipping functional tests !!!" def test_fake; assert true end end + + private + def with_cache(&block) + before = ActionController::Base.perform_caching + ActionController::Base.perform_caching = true + block.call + ActionController::Base.perform_caching = before + end end |