diff --git a/features/slate_documentation.feature b/features/slate_documentation.feature index d1d77b6c..e06bab9e 100644 --- a/features/slate_documentation.feature +++ b/features/slate_documentation.feature @@ -57,6 +57,7 @@ Feature: Generate Slate documentation from test examples end resource 'Orders' do + explanation "An Order represents an amount of money to be paid" get '/orders' do response_field :page, "Current page" @@ -214,6 +215,8 @@ Feature: Generate Slate documentation from test examples """ # Orders + An Order represents an amount of money to be paid + ## Creating an order diff --git a/lib/rspec_api_documentation/writers/slate_writer.rb b/lib/rspec_api_documentation/writers/slate_writer.rb index d2373dcb..58a96ce4 100644 --- a/lib/rspec_api_documentation/writers/slate_writer.rb +++ b/lib/rspec_api_documentation/writers/slate_writer.rb @@ -24,9 +24,8 @@ def write file.write markup_index_class.new(index, configuration).render IndexHelper.sections(index.examples, @configuration).each do |section| - file.write "# #{section[:resource_name]}\n\n" - section[:examples].sort_by!(&:description) unless configuration.keep_source_order + file.write "#{section[:resource_explanation]}\n\n" section[:examples].each do |example| markup_example = markup_example_class.new(example, configuration)