Commit 23a3932c authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'vij-snippet-controller-cleanup-2' into 'master'

Remove Snippets#show JSON format handling

See merge request gitlab-org/gitlab!45771
parents 898e2434 06997777
......@@ -57,11 +57,6 @@ module SnippetsActions
render 'show'
end
format.json do
conditionally_expand_blob(blob)
render_blob_json(blob)
end
format.js do
if @snippet.embeddable?
conditionally_expand_blobs(blobs)
......
......@@ -180,16 +180,6 @@ RSpec.describe Projects::SnippetsController do
end
end
describe 'GET #show as JSON' do
it 'renders the blob from the repository' do
project_snippet = create(:project_snippet, :public, :repository, project: project, author: user)
get :show, params: { namespace_id: project.namespace, project_id: project, id: project_snippet.to_param }, format: :json
expect(assigns(:blob)).to eq(project_snippet.blobs.first)
end
end
describe "GET #show for embeddable content" do
let(:project_snippet) { create(:project_snippet, :repository, snippet_permission, project: project, author: user) }
let(:extra_params) { {} }
......
......@@ -205,14 +205,6 @@ RSpec.describe SnippetsController do
end
end
end
context 'when requesting JSON' do
it 'renders the blob from the repository' do
get :show, params: { id: public_snippet.to_param }, format: :json
expect(assigns(:blob)).to eq(public_snippet.blobs.first)
end
end
end
describe 'POST #mark_as_spam' do
......
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