Fix documentation template
parent
2945e15d93
commit
0d8b587dd5
|
@ -1,6 +1,6 @@
|
|||
<% if response.success? %>
|
||||
# <%= request.method %> <%= request.path %>
|
||||
|
||||
# <%= request.method %> <%= request.path.first(65) %>
|
||||
<% if request.params.except(:controller, :action, :format).keys.length > 0 %>
|
||||
### Request
|
||||
|
||||
```
|
||||
|
@ -8,19 +8,15 @@
|
|||
JSON.pretty_generate(request.params.except(:controller, :action, :format))
|
||||
%>
|
||||
```
|
||||
|
||||
<% end %>
|
||||
### Response
|
||||
|
||||
```
|
||||
<%=
|
||||
begin
|
||||
if response.body.length > 500
|
||||
"Too big to display."
|
||||
else
|
||||
JSON.pretty_generate(response.body)
|
||||
end
|
||||
JSON.pretty_generate(JSON.parse(response.body)).first(500)
|
||||
rescue => e
|
||||
e.message
|
||||
"Empty Response"
|
||||
end
|
||||
%>
|
||||
```
|
||||
|
|
|
@ -35,7 +35,7 @@ RSpec.configure do |config|
|
|||
config.order = 'random'
|
||||
|
||||
if ENV['DOCS']
|
||||
config.before(:each, type: :controller) do
|
||||
config.after(:each, type: :controller) do
|
||||
SmarfDoc.run!(request, response)
|
||||
end
|
||||
|
||||
|
@ -44,3 +44,7 @@ RSpec.configure do |config|
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
# class Stub
|
||||
# def initialize(response)
|
||||
# end
|
Loading…
Reference in New Issue