Skip to content

Commit bf13e3e

Browse files
committed
Spec and changelog.
1 parent e2d86b3 commit bf13e3e

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11

22
n.n.n / 2016-03-16
33
==================
4+
[#365](https://github.com/ruby-grape/grape-swagger/pull/365)
5+
6+
- fixes passing markdown with redcarpet even with nil description and detail
7+
48
[#358](https://github.com/ruby-grape/grape-swagger/pull/358)
59

610
- removes `allowMultiple` property from params
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
require 'spec_helper'
2+
3+
describe 'details' do
4+
describe 'details, pass markdown with redcarpet even with nil description and detail', unless: RUBY_PLATFORM.eql?('java') do
5+
include_context "the api entities"
6+
7+
before :all do
8+
module TheApi
9+
class GfmRcDetailApi < Grape::API
10+
format :json
11+
12+
desc nil,
13+
detail: nil,
14+
entity: Entities::UseResponse,
15+
failure: [{code: 400, model: Entities::ApiError}]
16+
get '/use_gfm_rc_detail' do
17+
{ "declared_params" => declared(params) }
18+
end
19+
20+
add_swagger_documentation markdown: GrapeSwagger::Markdown::RedcarpetAdapter.new
21+
end
22+
end
23+
end
24+
25+
def app
26+
TheApi::GfmRcDetailApi
27+
end
28+
29+
subject do
30+
get '/swagger_doc'
31+
JSON.parse(last_response.body)
32+
end
33+
34+
specify do
35+
expect(subject['paths']['/use_gfm_rc_detail']['get']).not_to include('description')
36+
expect(subject['paths']['/use_gfm_rc_detail']['get']['description']).to eql(nil)
37+
end
38+
end
39+
end

0 commit comments

Comments
 (0)