Drop JSON response in Project Milestone along with avoiding error

This commit is contained in:
Takuya Noguchi 2017-06-17 15:40:12 +09:00
parent 391732a2c1
commit a48ac40710
3 changed files with 20 additions and 2 deletions

View file

@ -42,6 +42,10 @@ class Projects::MilestonesController < Projects::ApplicationController
def show
@project_namespace = @project.namespace.becomes(Namespace)
respond_to do |format|
format.html
end
end
def create

View file

@ -0,0 +1,5 @@
---
title: Drop JSON response in Project Milestone along with avoiding error
merge_request: 17977
author: Takuya Noguchi
type: fixed

View file

@ -20,14 +20,23 @@ describe Projects::MilestonesController do
describe "#show" do
render_views
def view_milestone
get :show, namespace_id: project.namespace.id, project_id: project.id, id: milestone.iid
def view_milestone(options = {})
params = { namespace_id: project.namespace.id, project_id: project.id, id: milestone.iid }
get :show, params.merge(options)
end
it 'shows milestone page' do
view_milestone
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