Skip to content
代码片段 群组 项目
提交 06997777 编辑于 作者: 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
上级 a3b8f271
No related branches found
No related tags found
无相关合并请求
...@@ -57,11 +57,6 @@ def show ...@@ -57,11 +57,6 @@ def show
render 'show' render 'show'
end end
format.json do
conditionally_expand_blob(blob)
render_blob_json(blob)
end
format.js do format.js do
if @snippet.embeddable? if @snippet.embeddable?
conditionally_expand_blobs(blobs) conditionally_expand_blobs(blobs)
......
...@@ -180,16 +180,6 @@ def mark_as_spam ...@@ -180,16 +180,6 @@ def mark_as_spam
end end
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 describe "GET #show for embeddable content" do
let(:project_snippet) { create(:project_snippet, :repository, snippet_permission, project: project, author: user) } let(:project_snippet) { create(:project_snippet, :repository, snippet_permission, project: project, author: user) }
let(:extra_params) { {} } let(:extra_params) { {} }
......
...@@ -205,14 +205,6 @@ ...@@ -205,14 +205,6 @@
end end
end 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 end
describe 'POST #mark_as_spam' do describe 'POST #mark_as_spam' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册