comparison test/functional/.svn/text-base/issues_controller_test.rb.svn-base @ 117:af80e5618e9b redmine-1.1

* Update to Redmine 1.1-stable branch (Redmine SVN rev 4707)
author Chris Cannam
date Thu, 13 Jan 2011 12:53:21 +0000
parents 94944d00e43c
children cbce1fd3b1b7
comparison
equal deleted inserted replaced
39:150ceac17a8d 117:af80e5618e9b
13 # 13 #
14 # You should have received a copy of the GNU General Public License 14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software 15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 require File.dirname(__FILE__) + '/../test_helper' 18 require File.expand_path('../../test_helper', __FILE__)
19 require 'issues_controller' 19 require 'issues_controller'
20 20
21 # Re-raise errors caught by the controller. 21 # Re-raise errors caught by the controller.
22 class IssuesController; def rescue_action(e) raise e end; end 22 class IssuesController; def rescue_action(e) raise e end; end
23 23
279 def test_show_by_manager 279 def test_show_by_manager
280 @request.session[:user_id] = 2 280 @request.session[:user_id] = 2
281 get :show, :id => 1 281 get :show, :id => 1
282 assert_response :success 282 assert_response :success
283 283
284 assert_tag :tag => 'a',
285 :content => /Quote/
286
284 assert_tag :tag => 'form', 287 assert_tag :tag => 'form',
285 :descendant => { :tag => 'fieldset', 288 :descendant => { :tag => 'fieldset',
286 :child => { :tag => 'legend', 289 :child => { :tag => 'legend',
287 :content => /Change properties/ } }, 290 :content => /Change properties/ } },
288 :descendant => { :tag => 'fieldset', 291 :descendant => { :tag => 'fieldset',
522 :parent_issue_id => 2} 525 :parent_issue_id => 2}
523 end 526 end
524 issue = Issue.find_by_subject('This is a child issue') 527 issue = Issue.find_by_subject('This is a child issue')
525 assert_not_nil issue 528 assert_not_nil issue
526 assert_equal Issue.find(2), issue.parent 529 assert_equal Issue.find(2), issue.parent
530 end
531
532 def test_post_create_subissue_with_non_numeric_parent_id
533 @request.session[:user_id] = 2
534
535 assert_difference 'Issue.count' do
536 post :create, :project_id => 1,
537 :issue => {:tracker_id => 1,
538 :subject => 'This is a child issue',
539 :parent_issue_id => 'ABC'}
540 end
541 issue = Issue.find_by_subject('This is a child issue')
542 assert_not_nil issue
543 assert_nil issue.parent
527 end 544 end
528 545
529 def test_post_create_should_send_a_notification 546 def test_post_create_should_send_a_notification
530 ActionMailer::Base.deliveries.clear 547 ActionMailer::Base.deliveries.clear
531 @request.session[:user_id] = 2 548 @request.session[:user_id] = 2