Project

General

Profile

Patch #35610 » 0002-Redirect_to-project_path-after-WikisController-destr.patch

Mischa The Evil, 2021-01-27 09:59

View differences:

app/controllers/wikis_controller.rb
def destroy
if request.post? && params[:confirm] && @project.wiki
@project.wiki.destroy
redirect_to settings_project_path(@project, :tab => 'wiki')
redirect_to project_path(@project)
end
end
end
test/functional/wikis_controller_test.rb
@request.session[:user_id] = 1
post :destroy, :params => {:id => 1, :confirm => 1}
assert_redirected_to :controller => 'projects',
:action => 'settings', :id => 'ecookbook', :tab => 'wiki'
:action => 'show', :id => 'ecookbook'
assert_nil Project.find(1).wiki
end
(2-2/3)