diff options
author | Go MAEDA <maeda@farend.jp> | 2021-05-28 08:37:30 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-05-28 08:37:30 +0000 |
commit | 5ac8f70d108a4d41e3f5954845bf64946e5caa28 (patch) | |
tree | e883e410a2b637d01e6701a3df51025cca6298a4 /test/functional | |
parent | 66fc9f463dbca69529df106338cafcc46f5fa115 (diff) | |
download | redmine-5ac8f70d108a4d41e3f5954845bf64946e5caa28.tar.gz redmine-5ac8f70d108a4d41e3f5954845bf64946e5caa28.zip |
Render Textile and Markdown files in the repository browser (#16849).
Patch by Takenori TAKAKI.
git-svn-id: http://svn.redmine.org/redmine/trunk@21013 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/repositories_subversion_controller_test.rb | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index 6988d2a5d..f6db7c002 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 = 12 + NUM_REV = 13 def setup super @@ -204,7 +204,8 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest ) assert_response :success assert_select 'table.changesets tbody' do - assert_select 'tr', 7 + assert_select 'tr', 8 + assert_select 'tr td.id a', :text => '13' assert_select 'tr td.id a', :text => '12' assert_select 'tr td.id a', :text => '10' assert_select 'tr td.id a', :text => '9' @@ -280,6 +281,32 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_select 'audio[src=?]', "/projects/subproject1/repository/#{@repository.id}/raw/subversion_test/folder/subfolder/chords.mp3" end + def text_entry_should_preview_markdown + get( + :entry, + :params => { + :id => PRJ_ID, + :repository_id => @repository.id, + :path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'testfile.md'])[:param] + } + ) + assert_response :success + assert_select 'div.wiki', :html => "<h1>Header 1</h1>\n\n<h2>Header 2</h2>\n\n<h3>Header 3</h3>" + end + + def text_entry_should_preview_textile + get( + :entry, + :params => { + :id => PRJ_ID, + :repository_id => @repository.id, + :path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'testfile.textile'])[:param] + } + ) + assert_response :success + assert_select 'div.wiki', :html => "<h1>Header 1</h1>\n\n\n\t<h2>Header 2</h2>\n\n\n\t<h3>Header 3</h3>" + end + def test_entry_at_given_revision assert_equal 0, @repository.changesets.count @repository.fetch_changesets |