summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-02-04 05:32:04 +0000
committerGo MAEDA <maeda@farend.jp>2020-02-04 05:32:04 +0000
commita0b909d523969194f0bf1adeb862e2c4335e32e9 (patch)
treecaa4e183d015c85f9ac0ae42b444043e97439645 /test
parent01f523f1658bdac92cfd2d1bfeb6999db2f23b46 (diff)
downloadredmine-a0b909d523969194f0bf1adeb862e2c4335e32e9.tar.gz
redmine-a0b909d523969194f0bf1adeb862e2c4335e32e9.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/repositories/subversion_repository.dump.gzbin12819 -> 114931 bytes
-rw-r--r--test/functional/repositories_subversion_controller_test.rb21
-rw-r--r--test/unit/repository_subversion_test.rb8
3 files changed, 21 insertions, 8 deletions
diff --git a/test/fixtures/repositories/subversion_repository.dump.gz b/test/fixtures/repositories/subversion_repository.dump.gz
index b47542f17..f08858eed 100644
--- a/test/fixtures/repositories/subversion_repository.dump.gz
+++ b/test/fixtures/repositories/subversion_repository.dump.gz
Binary files 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