mirror of
https://github.com/redmine/redmine.git
synced 2025-11-13 08:46:01 +01:00
Export a version as changelog text (#36679).
Patch by Mizuki ISHIKAWA. git-svn-id: https://svn.redmine.org/redmine/trunk@22179 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
require_relative '../test_helper'
|
||||
|
||||
class VersionsControllerTest < Redmine::ControllerTest
|
||||
include Redmine::I18n
|
||||
fixtures :projects, :enabled_modules,
|
||||
:trackers, :projects_trackers,
|
||||
:versions, :issue_statuses, :issue_categories, :enumerations,
|
||||
@@ -220,6 +221,18 @@ class VersionsControllerTest < Redmine::ControllerTest
|
||||
assert_select 'a.icon.icon-add', :text => 'New issue'
|
||||
end
|
||||
|
||||
def test_show_with_text_format
|
||||
version = Version.find(2)
|
||||
get :show, params: {id: version.id, format: :text}
|
||||
assert_response :success
|
||||
assert_equal 'text/plain', response.media_type
|
||||
|
||||
result = response.body.split("\n\n")
|
||||
assert_equal "# #{version.name}", result[0]
|
||||
assert_equal format_date(version.effective_date), result[1]
|
||||
assert_equal version.description, result[2]
|
||||
end
|
||||
|
||||
def test_new
|
||||
@request.session[:user_id] = 2
|
||||
get :new, :params => {:project_id => '1'}
|
||||
|
||||
Reference in New Issue
Block a user