From a0b909d523969194f0bf1adeb862e2c4335e32e9 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 4 Feb 2020 05:32:04 +0000 Subject: Repository browser does not render previews for audio/video files (#32153). Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@19492 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../repositories/subversion_repository.dump.gz | Bin 12819 -> 114931 bytes .../repositories_subversion_controller_test.rb | 21 +++++++++++++++++---- test/unit/repository_subversion_test.rb | 8 ++++---- 3 files changed, 21 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/fixtures/repositories/subversion_repository.dump.gz b/test/fixtures/repositories/subversion_repository.dump.gz index b47542f17..f08858eed 100644 Binary files a/test/fixtures/repositories/subversion_repository.dump.gz and b/test/fixtures/repositories/subversion_repository.dump.gz differ diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index 30fcf2064..b1ffd6fd9 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -27,7 +27,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest :issue_categories, :enumerations, :custom_fields, :custom_values, :trackers PRJ_ID = 3 - NUM_REV = 11 + NUM_REV = 12 def setup super @@ -78,7 +78,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_select 'table.changesets tbody' do assert_select 'tr', 10 - assert_select 'tr td.id a', :text => '11' + assert_select 'tr td.id a', :text => '12' end assert_select 'input[name=rev]' @@ -203,9 +203,9 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest } ) assert_response :success - assert_select 'table.changesets tbody' do - assert_select 'tr', 6 + assert_select 'tr', 7 + assert_select 'tr td.id a', :text => '12' assert_select 'tr td.id a', :text => '10' assert_select 'tr td.id a', :text => '9' assert_select 'tr td.id a', :text => '7' @@ -267,6 +267,19 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_select 'img[src=?]', "/projects/subproject1/repository/#{@repository.id}/raw/subversion_test/folder/subfolder/rubylogo.gif" end + def test_entry_should_preview_audio + get( + :entry, + :params => { + :id => PRJ_ID, + :repository_id => @repository.id, + :path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'chords.mp3'])[:param] + } + ) + assert_response :success + assert_select 'audio[src=?]', "/projects/subproject1/repository/#{@repository.id}/raw/subversion_test/folder/subfolder/chords.mp3" + end + def test_entry_at_given_revision assert_equal 0, @repository.changesets.count @repository.fetch_changesets diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb index df567f61f..94ac7483d 100644 --- a/test/unit/repository_subversion_test.rb +++ b/test/unit/repository_subversion_test.rb @@ -24,7 +24,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase include Redmine::I18n - NUM_REV = 11 + NUM_REV = 12 def setup User.current = nil @@ -98,7 +98,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase @project.reload assert_equal NUM_REV, @repository.changesets.count - assert_equal 20, @repository.filechanges.count + assert_equal 21, @repository.filechanges.count assert_equal 'Initial import.', @repository.changesets.find_by_revision('1').comments end @@ -142,7 +142,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase # with path changesets = @repository.latest_changesets('subversion_test/folder', nil) - assert_equal ["10", "9", "7", "6", "5", "2"], changesets.collect(&:revision) + assert_equal ["12", "10", "9", "7", "6", "5", "2"], changesets.collect(&:revision) # with path and revision changesets = @repository.latest_changesets('subversion_test/folder', 8) @@ -278,7 +278,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase @repository.fetch_changesets @project.reload assert_equal NUM_REV, @repository.changesets.count - changeset = @repository.find_changeset_by_name('11') + changeset = @repository.find_changeset_by_name('12') assert_nil changeset.next end else -- cgit v1.2.3