Commit 06997777 authored by Vijay Hawoldar's avatar Vijay Hawoldar

Remove snippets#show JSON format handling

The JSON format handling for snippets#show endpoint does
not appear to be in use since moving to Vue, this commit
removes it to clean up the controllers
parent a3b8f271
......@@ -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