comparison test/functional/issues_controller_test.rb @ 1294:3e4c3460b6ca redmine-2.2

Update to Redmine SVN revision 11972 on 2.2-stable branch
author Chris Cannam
date Fri, 14 Jun 2013 09:01:12 +0100
parents 433d4f72a19b
children 622f24f53b42 261b3d9a4903
comparison
equal deleted inserted replaced
1115:433d4f72a19b 1294:3e4c3460b6ca
2354 assert_tag 'select', :attributes => {:name => 'issue[project_id]'}, 2354 assert_tag 'select', :attributes => {:name => 'issue[project_id]'},
2355 :child => {:tag => 'option', :attributes => {:value => '1', :selected => 'selected'}, :content => 'eCookbook'} 2355 :child => {:tag => 'option', :attributes => {:value => '1', :selected => 'selected'}, :content => 'eCookbook'}
2356 assert_tag 'select', :attributes => {:name => 'issue[project_id]'}, 2356 assert_tag 'select', :attributes => {:name => 'issue[project_id]'},
2357 :child => {:tag => 'option', :attributes => {:value => '2', :selected => nil}, :content => 'OnlineStore'} 2357 :child => {:tag => 'option', :attributes => {:value => '2', :selected => nil}, :content => 'OnlineStore'}
2358 assert_tag 'input', :attributes => {:name => 'copy_from', :value => '1'} 2358 assert_tag 'input', :attributes => {:name => 'copy_from', :value => '1'}
2359
2360 # "New issue" menu item should not link to copy
2361 assert_select '#main-menu a.new-issue[href=/projects/ecookbook/issues/new]'
2359 end 2362 end
2360 2363
2361 def test_new_as_copy_with_attachments_should_show_copy_attachments_checkbox 2364 def test_new_as_copy_with_attachments_should_show_copy_attachments_checkbox
2362 @request.session[:user_id] = 2 2365 @request.session[:user_id] = 2
2363 issue = Issue.find(3) 2366 issue = Issue.find(3)
2907 2910
2908 t = issue.time_entries.find_by_comments('test_put_update_with_note_and_spent_time') 2911 t = issue.time_entries.find_by_comments('test_put_update_with_note_and_spent_time')
2909 assert_not_nil t 2912 assert_not_nil t
2910 assert_equal 2.5, t.hours 2913 assert_equal 2.5, t.hours
2911 assert_equal spent_hours_before + 2.5, issue.spent_hours 2914 assert_equal spent_hours_before + 2.5, issue.spent_hours
2915 end
2916
2917 def test_put_update_should_preserve_parent_issue_even_if_not_visible
2918 parent = Issue.generate!(:project_id => 1, :is_private => true)
2919 issue = Issue.generate!(:parent_issue_id => parent.id)
2920 assert !parent.visible?(User.find(3))
2921 @request.session[:user_id] = 3
2922
2923 get :edit, :id => issue.id
2924 assert_select 'input[name=?][value=?]', 'issue[parent_issue_id]', parent.id.to_s
2925
2926 put :update, :id => issue.id, :issue => {:subject => 'New subject', :parent_issue_id => parent.id.to_s}
2927 assert_response 302
2928 assert_equal parent, issue.parent
2912 end 2929 end
2913 2930
2914 def test_put_update_with_attachment_only 2931 def test_put_update_with_attachment_only
2915 set_tmp_attachments_directory 2932 set_tmp_attachments_directory
2916 2933