Commit a48ac407 authored by Takuya Noguchi's avatar Takuya Noguchi

Drop JSON response in Project Milestone along with avoiding error

parent 391732a2
...@@ -42,6 +42,10 @@ class Projects::MilestonesController < Projects::ApplicationController ...@@ -42,6 +42,10 @@ class Projects::MilestonesController < Projects::ApplicationController
def show def show
@project_namespace = @project.namespace.becomes(Namespace) @project_namespace = @project.namespace.becomes(Namespace)
respond_to do |format|
format.html
end
end end
def create def create
......
---
title: Drop JSON response in Project Milestone along with avoiding error
merge_request: 17977
author: Takuya Noguchi
type: fixed
...@@ -20,14 +20,23 @@ describe Projects::MilestonesController do ...@@ -20,14 +20,23 @@ describe Projects::MilestonesController do
describe "#show" do describe "#show" do
render_views render_views
def view_milestone def view_milestone(options = {})
get :show, namespace_id: project.namespace.id, project_id: project.id, id: milestone.iid params = { namespace_id: project.namespace.id, project_id: project.id, id: milestone.iid }
get :show, params.merge(options)
end end
it 'shows milestone page' do it 'shows milestone page' do
view_milestone view_milestone
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.content_type).to eq 'text/html'
end
it 'returns milestone json' do
view_milestone format: :json
expect(response).to have_http_status(404)
expect(response.content_type).to eq 'application/json'
end 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