Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/views/downloads/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<%= render "downloads/download_preface" %>

<div id="chapters" class="userstuff">
<% 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 %>
Expand Down
33 changes: 33 additions & 0 deletions features/works/work_download.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Loading