@@ -120,8 +120,7 class IssuesController < ApplicationController | |||
|
120 | 120 | # Tracker must be set before custom field values |
|
121 | 121 | @issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first) |
|
122 | 122 | if @issue.tracker.nil? |
|
123 |
|
|
|
124 | render :nothing => true, :layout => true | |
|
123 | render_error 'No tracker is associated to this project. Please check the Project settings.' | |
|
125 | 124 | return |
|
126 | 125 | end |
|
127 | 126 | if params[:issue].is_a?(Hash) |
@@ -132,8 +131,7 class IssuesController < ApplicationController | |||
|
132 | 131 | |
|
133 | 132 | default_status = IssueStatus.default |
|
134 | 133 | unless default_status |
|
135 |
|
|
|
136 | render :nothing => true, :layout => true | |
|
134 | render_error 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").' | |
|
137 | 135 | return |
|
138 | 136 | end |
|
139 | 137 | @issue.status = default_status |
@@ -379,6 +379,28 class IssuesControllerTest < Test::Unit::TestCase | |||
|
379 | 379 | assert_equal Project.find(1).trackers.first, issue.tracker |
|
380 | 380 | end |
|
381 | 381 | |
|
382 | def test_get_new_with_no_default_status_should_display_an_error | |
|
383 | @request.session[:user_id] = 2 | |
|
384 | IssueStatus.delete_all | |
|
385 | ||
|
386 | get :new, :project_id => 1 | |
|
387 | assert_response 500 | |
|
388 | assert_not_nil flash[:error] | |
|
389 | assert_tag :tag => 'div', :attributes => { :class => /error/ }, | |
|
390 | :content => /No default issue/ | |
|
391 | end | |
|
392 | ||
|
393 | def test_get_new_with_no_tracker_should_display_an_error | |
|
394 | @request.session[:user_id] = 2 | |
|
395 | Tracker.delete_all | |
|
396 | ||
|
397 | get :new, :project_id => 1 | |
|
398 | assert_response 500 | |
|
399 | assert_not_nil flash[:error] | |
|
400 | assert_tag :tag => 'div', :attributes => { :class => /error/ }, | |
|
401 | :content => /No tracker/ | |
|
402 | end | |
|
403 | ||
|
382 | 404 | def test_update_new_form |
|
383 | 405 | @request.session[:user_id] = 2 |
|
384 | 406 | xhr :post, :new, :project_id => 1, |
General Comments 0
You need to be logged in to leave comments.
Login now