@@ -269,6 +269,7 private | |||||
269 | @priorities = IssuePriority.all |
|
269 | @priorities = IssuePriority.all | |
270 | @edit_allowed = User.current.allowed_to?(:edit_issues, @project) |
|
270 | @edit_allowed = User.current.allowed_to?(:edit_issues, @project) | |
271 | @time_entry = TimeEntry.new |
|
271 | @time_entry = TimeEntry.new | |
|
272 | @time_entry.attributes = params[:time_entry] | |||
272 |
|
273 | |||
273 | @notes = params[:notes] || (params[:issue].present? ? params[:issue][:notes] : nil) |
|
274 | @notes = params[:notes] || (params[:issue].present? ? params[:issue][:notes] : nil) | |
274 | @issue.init_journal(User.current, @notes) |
|
275 | @issue.init_journal(User.current, @notes) |
@@ -737,7 +737,8 class IssuesControllerTest < ActionController::TestCase | |||||
737 |
|
737 | |||
738 | def test_get_edit_with_params |
|
738 | def test_get_edit_with_params | |
739 | @request.session[:user_id] = 2 |
|
739 | @request.session[:user_id] = 2 | |
740 | get :edit, :id => 1, :issue => { :status_id => 5, :priority_id => 7 } |
|
740 | get :edit, :id => 1, :issue => { :status_id => 5, :priority_id => 7 }, | |
|
741 | :time_entry => { :hours => '2.5', :comments => 'test_get_edit_with_params', :activity_id => TimeEntryActivity.first.id } | |||
741 | assert_response :success |
|
742 | assert_response :success | |
742 | assert_template 'edit' |
|
743 | assert_template 'edit' | |
743 |
|
744 | |||
@@ -755,6 +756,12 class IssuesControllerTest < ActionController::TestCase | |||||
755 | :child => { :tag => 'option', |
|
756 | :child => { :tag => 'option', | |
756 | :content => 'Urgent', |
|
757 | :content => 'Urgent', | |
757 | :attributes => { :selected => 'selected' } } |
|
758 | :attributes => { :selected => 'selected' } } | |
|
759 | ||||
|
760 | assert_tag :input, :attributes => { :name => 'time_entry[hours]', :value => '2.5' } | |||
|
761 | assert_tag :select, :attributes => { :name => 'time_entry[activity_id]' }, | |||
|
762 | :child => { :tag => 'option', | |||
|
763 | :attributes => { :selected => 'selected', :value => TimeEntryActivity.first.id } } | |||
|
764 | assert_tag :input, :attributes => { :name => 'time_entry[comments]', :value => 'test_get_edit_with_params' } | |||
758 | end |
|
765 | end | |
759 |
|
766 | |||
760 | def test_update_edit_form |
|
767 | def test_update_edit_form |
General Comments 0
You need to be logged in to leave comments.
Login now