mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 18:17:27 +02:00
Added the hability to copy an issue.
It can be done from the 'issue/show' view or from the context menu on the issue list. The Copy functionality is of course only available if the user is allowed to create an issue. It copies the issue attributes and the custom fields values. git-svn-id: http://redmine.rubyforge.org/svn/trunk@873 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -18,13 +18,23 @@
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
|
||||
class IssueTest < Test::Unit::TestCase
|
||||
fixtures :projects, :users, :members, :trackers, :issue_statuses, :issue_categories, :enumerations, :issues
|
||||
fixtures :projects, :users, :members, :trackers, :issue_statuses, :issue_categories, :enumerations, :issues, :custom_fields, :custom_values
|
||||
|
||||
def test_category_based_assignment
|
||||
issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'Assignment test', :description => 'Assignment test', :category_id => 1)
|
||||
assert_equal IssueCategory.find(1).assigned_to, issue.assigned_to
|
||||
end
|
||||
|
||||
def test_copy
|
||||
issue = Issue.new.copy_from(1)
|
||||
assert issue.save
|
||||
issue.reload
|
||||
orig = Issue.find(1)
|
||||
assert_equal orig.subject, issue.subject
|
||||
assert_equal orig.tracker, issue.tracker
|
||||
assert_equal orig.custom_values.first.value, issue.custom_values.first.value
|
||||
end
|
||||
|
||||
def test_close_duplicates
|
||||
# Create 3 issues
|
||||
issue1 = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'Duplicates test', :description => 'Duplicates test')
|
||||
|
||||
Reference in New Issue
Block a user