diff --git a/app/views/downloads/show.html.erb b/app/views/downloads/show.html.erb index 03feed1a161..0eb69524ac6 100644 --- a/app/views/downloads/show.html.erb +++ b/app/views/downloads/show.html.erb @@ -1,7 +1,8 @@ <%= render "downloads/download_preface" %>
- <% if @chapters.size > 1 %> + <%# if chaptered and one chapter (this include notes and title) OR more than one chap %> + <% if (@work.chaptered? && @chapters.size == 1) || @chapters.size > 1 %> <% for chapter in @chapters %> <%= render "downloads/download_chapter", chapter: chapter %> <% end %> diff --git a/features/works/work_download.feature b/features/works/work_download.feature index 87b8a0743ae..54e16e5baec 100644 --- a/features/works/work_download.feature +++ b/features/works/work_download.feature @@ -438,3 +438,36 @@ Feature: Download a work And I should see "Chapter 1" And I should see "Chapter 2: Chapter Two Title" + Scenario: Download work with only one chapter expecting more chapters include chapter title and notes + + Given I am logged in as "myname" + And I set up the draft "Download" + And I fill in "Work Title" with "Download" + And I fill in "content" with "Content for chapter one." + And I check "This work has multiple chapters" + And I fill in "Chapter 1 of" with "?" + And I check "at the beginning" + And I fill in "Notes" with "Overall start notes" + And I check "at the end" + And I fill in "End Notes" with "Overall end notes" + And I press "Post" + When I go to the 1st chapter of the work "Download" + And I follow "Edit Chapter" + And I fill in "Chapter Title" with "Chapter One Title" + And I check "at the beginning" + And I fill in "Notes" with "Text of notes at chapter start" + And I check "at the end" + And I fill in "End Notes" with "Text of notes at chapter end" + And I press "Update" + When I view the work "Download" + And I follow "HTML" + Then I should receive a file of type "html" + And I should see "Overall start notes" + And I should see "Overall end notes" + And I should see "Chapter 1: Chapter One Title" + And I should see "Chapter Notes" + And I should see "Text of notes at chapter start" + And I should see "See the end of the chapter for more notes" + And I should see "Chapter End Notes" + And I should see "Text of notes at chapter end" +