Commit 642dc4eb authored by Kerri Miller's avatar Kerri Miller

Merge branch '356502-fj-avoid-loading-wiki-page-content-for-some-actions' into 'master'

Prevent loading wiki content for destroy and diff actions

See merge request gitlab-org/gitlab!83595
parents 9bab85c5 b78a2482
......@@ -312,7 +312,7 @@ module WikiActions
end
def load_content?
return false if params[:action] == 'history'
return false if %w[history destroy diff].include?(params[:action])
return false if params[:action] == 'show' && Feature.enabled?(:wiki_async_load, container, default_enabled: :yaml)
true
......
......@@ -150,6 +150,7 @@ RSpec.shared_examples 'wiki controller actions' do
expect(response).to render_template('shared/wikis/diff')
expect(assigns(:diffs)).to be_a(Gitlab::Diff::FileCollection::Base)
expect(assigns(:diff_notes_disabled)).to be(true)
expect(assigns(:page).content).to be_empty
end
end
......@@ -475,9 +476,13 @@ RSpec.shared_examples 'wiki controller actions' do
context 'when page exists' do
shared_examples 'deletes the page' do
specify do
expect do
request
end.to change { wiki.list_pages.size }.by(-1)
aggregate_failures do
expect do
request
end.to change { wiki.list_pages.size }.by(-1)
expect(assigns(:page).content).to be_empty
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment