summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/issue.rb5
-rw-r--r--app/views/issues/edit.html.erb2
-rw-r--r--test/functional/issues_controller_test.rb11
3 files changed, 17 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index c7ad2a063..13299b60e 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -873,6 +873,11 @@ class Issue < ActiveRecord::Base
end
end
+ # Returns the original tracker
+ def tracker_was
+ Tracker.find_by_id(tracker_id_was)
+ end
+
# Returns the users that should be notified
def notified_users
notified = []
diff --git a/app/views/issues/edit.html.erb b/app/views/issues/edit.html.erb
index 1cd61b783..da80a0834 100644
--- a/app/views/issues/edit.html.erb
+++ b/app/views/issues/edit.html.erb
@@ -1,4 +1,4 @@
-<h2><%= "#{@issue.tracker.name} ##{@issue.id}" %></h2>
+<h2><%= "#{@issue.tracker_was} ##{@issue.id}" %></h2>
<%= render :partial => 'edit' %>
<% content_for :header_tags do %>
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index a69b85630..d02fb1b6d 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -3057,6 +3057,17 @@ class IssuesControllerTest < ActionController::TestCase
assert_mail_body_match "Project changed from eCookbook to OnlineStore", mail
end
+ def test_put_update_trying_to_move_issue_to_project_without_tracker_should_not_error
+ target = Project.generate!(:tracker_ids => [])
+ assert target.trackers.empty?
+ issue = Issue.generate!
+ @request.session[:user_id] = 1
+
+ put :update, :id => issue.id, :issue => {:project_id => target.id}
+ assert_response :success
+ assert_template 'edit'
+ end
+
def test_put_update_with_tracker_change
@request.session[:user_id] = 2
ActionMailer::Base.deliveries.clear