Fix documentation template

pull/303/head
Rick Carlino 2016-12-07 13:09:38 -06:00
parent 2945e15d93
commit 0d8b587dd5
2 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,6 @@
<% if response.success? %> <% if response.success? %>
# <%= request.method %> <%= request.path %> # <%= request.method %> <%= request.path.first(65) %>
<% if request.params.except(:controller, :action, :format).keys.length > 0 %>
### Request ### Request
``` ```
@ -8,19 +8,15 @@
JSON.pretty_generate(request.params.except(:controller, :action, :format)) JSON.pretty_generate(request.params.except(:controller, :action, :format))
%> %>
``` ```
<% end %>
### Response ### Response
``` ```
<%= <%=
begin begin
if response.body.length > 500 JSON.pretty_generate(JSON.parse(response.body)).first(500)
"Too big to display."
else
JSON.pretty_generate(response.body)
end
rescue => e rescue => e
e.message "Empty Response"
end end
%> %>
``` ```

View File

@ -35,7 +35,7 @@ RSpec.configure do |config|
config.order = 'random' config.order = 'random'
if ENV['DOCS'] if ENV['DOCS']
config.before(:each, type: :controller) do config.after(:each, type: :controller) do
SmarfDoc.run!(request, response) SmarfDoc.run!(request, response)
end end
@ -44,3 +44,7 @@ RSpec.configure do |config|
end end
end end
end end
# class Stub
# def initialize(response)
# end