Defect #33116 ยป 33116.patch
app/controllers/documents_controller.rb | ||
---|---|---|
83 | 83 | |
84 | 84 |
def destroy |
85 | 85 |
@document.destroy if request.delete? |
86 |
flash[:notice] = l(:notice_successful_delete) |
|
86 | 87 |
redirect_to project_documents_path(@project) |
87 | 88 |
end |
88 | 89 |
app/controllers/issues_controller.rb | ||
---|---|---|
448 | 448 |
end |
449 | 449 |
end |
450 | 450 |
respond_to do |format| |
451 |
format.html {redirect_back_or_default _project_issues_path(@project)} |
|
451 |
format.html { |
|
452 |
flash[:notice] = l(:notice_successful_delete) |
|
453 |
redirect_back_or_default _project_issues_path(@project) |
|
454 |
} |
|
452 | 455 |
format.api {render_api_ok} |
453 | 456 |
end |
454 | 457 |
end |
app/controllers/news_controller.rb | ||
---|---|---|
115 | 115 |
def destroy |
116 | 116 |
@news.destroy |
117 | 117 |
respond_to do |format| |
118 |
format.html { redirect_to project_news_index_path(@project) } |
|
118 |
format.html { |
|
119 |
flash[:notice] = l(:notice_successful_delete) |
|
120 |
redirect_to project_news_index_path(@project) |
|
121 |
} |
|
119 | 122 |
format.api { render_api_ok } |
120 | 123 |
end |
121 | 124 |
end |
app/controllers/wiki_controller.rb | ||
---|---|---|
284 | 284 |
end |
285 | 285 |
@page.destroy |
286 | 286 |
respond_to do |format| |
287 |
format.html { redirect_to project_wiki_index_path(@project) } |
|
287 |
format.html { |
|
288 |
flash[:notice] = l(:notice_successful_delete) |
|
289 |
redirect_to project_wiki_index_path(@project) |
|
290 |
} |
|
288 | 291 |
format.api { render_api_ok } |
289 | 292 |
end |
290 | 293 |
end |
test/functional/documents_controller_test.rb | ||
---|---|---|
240 | 240 |
} |
241 | 241 |
end |
242 | 242 |
assert_redirected_to '/projects/ecookbook/documents' |
243 |
assert_equal 'Successful deletion.', flash[:notice] |
|
243 | 244 |
assert_nil Document.find_by_id(1) |
244 | 245 |
end |
245 | 246 |
test/functional/issues_controller_test.rb | ||
---|---|---|
7491 | 7491 |
delete(:destroy, :params => {:id => 2}) |
7492 | 7492 |
end |
7493 | 7493 |
assert_redirected_to :action => 'index', :project_id => 'ecookbook' |
7494 |
assert_equal 'Successful deletion.', flash[:notice] |
|
7494 | 7495 |
assert_nil Issue.find_by_id(2) |
7495 | 7496 |
end |
7496 | 7497 | |
... | ... | |
7570 | 7571 |
end |
7571 | 7572 |
end |
7572 | 7573 |
assert_redirected_to :action => 'index', :project_id => 'ecookbook' |
7574 |
assert_equal 'Successful deletion.', flash[:notice] |
|
7573 | 7575 |
assert !(Issue.find_by_id(1) || Issue.find_by_id(3)) |
7574 | 7576 |
assert_nil TimeEntry.find_by_id([1, 2]) |
7575 | 7577 |
end |
... | ... | |
7591 | 7593 |
end |
7592 | 7594 |
end |
7593 | 7595 |
assert_redirected_to :action => 'index', :project_id => 'ecookbook' |
7596 |
assert_equal 'Successful deletion.', flash[:notice] |
|
7594 | 7597 |
assert !(Issue.find_by_id(1) || Issue.find_by_id(3)) |
7595 | 7598 |
assert_nil TimeEntry.find(1).issue_id |
7596 | 7599 |
assert_nil TimeEntry.find(2).issue_id |
... | ... | |
7612 | 7615 |
end |
7613 | 7616 |
end |
7614 | 7617 |
assert_redirected_to :action => 'index', :project_id => 'ecookbook' |
7618 |
assert_equal 'Successful deletion.', flash[:notice] |
|
7615 | 7619 |
assert !(Issue.find_by_id(1) || Issue.find_by_id(3)) |
7616 | 7620 |
assert_equal 2, TimeEntry.find(1).issue_id |
7617 | 7621 |
assert_equal 2, TimeEntry.find(2).issue_id |
... | ... | |
7636 | 7640 |
} |
7637 | 7641 |
) |
7638 | 7642 |
assert_response 302 |
7643 |
assert_equal 'Successful deletion.', flash[:notice] |
|
7639 | 7644 |
end |
7640 | 7645 |
end |
7641 | 7646 |
assert_equal 3, target.time_entries.count |
... | ... | |
7712 | 7717 |
) |
7713 | 7718 |
end |
7714 | 7719 |
assert_redirected_to :controller => 'issues', :action => 'index' |
7720 |
assert_equal 'Successful deletion.', flash[:notice] |
|
7715 | 7721 |
assert !(Issue.find_by_id(1) || Issue.find_by_id(2) || Issue.find_by_id(6)) |
7716 | 7722 |
end |
7717 | 7723 | |
... | ... | |
7732 | 7738 |
) |
7733 | 7739 |
end |
7734 | 7740 |
assert_response 302 |
7741 |
assert_equal 'Successful deletion.', flash[:notice] |
|
7735 | 7742 |
end |
7736 | 7743 | |
7737 | 7744 |
def test_destroy_invalid_should_respond_with_404 |
... | ... | |
7752 | 7759 |
delete(:destroy, :params => {:id => issue.id}) |
7753 | 7760 |
end |
7754 | 7761 |
assert_response 302 |
7762 |
assert_equal 'Successful deletion.', flash[:notice] |
|
7755 | 7763 |
end |
7756 | 7764 | |
7757 | 7765 |
def test_destroy_without_permission_on_tracker_should_be_denied |
test/functional/news_controller_test.rb | ||
---|---|---|
243 | 243 |
@request.session[:user_id] = 2 |
244 | 244 |
delete(:destroy, :params => {:id => 1}) |
245 | 245 |
assert_redirected_to '/projects/ecookbook/news' |
246 |
assert_equal 'Successful deletion.', flash[:notice] |
|
246 | 247 |
assert_nil News.find_by_id(1) |
247 | 248 |
end |
248 | 249 |
end |
test/functional/wiki_controller_test.rb | ||
---|---|---|
914 | 914 |
@request.session[:user_id] = 2 |
915 | 915 |
delete :destroy, :params => {:project_id => 1, :id => 'Child_2'} |
916 | 916 |
assert_redirected_to :action => 'index', :project_id => 'ecookbook' |
917 |
assert_equal 'Successful deletion.', flash[:notice] |
|
917 | 918 |
end |
918 | 919 | |
919 | 920 |
def test_destroy_parent_should_ask_confirmation |
... | ... | |
935 | 936 |
delete :destroy, :params => {:project_id => 1, :id => 'Another_page', :todo => 'nullify'} |
936 | 937 |
end |
937 | 938 |
assert_redirected_to :action => 'index', :project_id => 'ecookbook' |
939 |
assert_equal 'Successful deletion.', flash[:notice] |
|
938 | 940 |
assert_nil WikiPage.find_by_id(2) |
939 | 941 |
end |
940 | 942 | |
... | ... | |
944 | 946 |
delete :destroy, :params => {:project_id => 1, :id => 'Another_page', :todo => 'destroy'} |
945 | 947 |
end |
946 | 948 |
assert_redirected_to :action => 'index', :project_id => 'ecookbook' |
949 |
assert_equal 'Successful deletion.', flash[:notice] |
|
947 | 950 |
assert_nil WikiPage.find_by_id(2) |
948 | 951 |
assert_nil WikiPage.find_by_id(5) |
949 | 952 |
end |
... | ... | |
954 | 957 |
delete :destroy, :params => {:project_id => 1, :id => 'Another_page', :todo => 'reassign', :reassign_to_id => 1} |
955 | 958 |
end |
956 | 959 |
assert_redirected_to :action => 'index', :project_id => 'ecookbook' |
960 |
assert_equal 'Successful deletion.', flash[:notice] |
|
957 | 961 |
assert_nil WikiPage.find_by_id(2) |
958 | 962 |
assert_equal WikiPage.find(1), WikiPage.find_by_id(5).parent |
959 | 963 |
end |