Feature #16849 » 16849.patch
| app/views/repositories/entry.html.erb | ||
|---|---|---|
|
<% if Redmine::MimeType.is_type?('image', @path) %>
|
||
|
<%= render :partial => 'common/image', :locals => {:path => @raw_url, :alt => @path} %>
|
||
|
<% elsif Redmine::MimeType.of(@path) == 'text/x-textile' %>
|
||
|
<%= render :partial => 'common/markup', :locals => {:markup_text_formatting => 'textile', :markup_text => @content} %>
|
||
|
<% elsif Redmine::MimeType.of(@path) == 'text/markdown' %>
|
||
|
<%= render :partial => 'common/markup', :locals => {:markup_text_formatting => 'markdown', :markup_text => @content} %>
|
||
|
<% elsif @content %>
|
||
|
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
|
||
|
<% else %>
|
||
| test/functional/repositories_subversion_controller_test.rb | ||
|---|---|---|
|
:issue_categories, :enumerations, :custom_fields, :custom_values, :trackers
|
||
|
PRJ_ID = 3
|
||
|
NUM_REV = 12
|
||
|
NUM_REV = 13
|
||
|
def setup
|
||
|
super
|
||
| ... | ... | |
|
)
|
||
|
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'
|
||
| ... | ... | |
|
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
|
||