Skip to content

Commit

Permalink
AO3-5065 Fix error where posting chapter would not post work (#2961)
Browse files Browse the repository at this point in the history
* AO3-5065 Fix chapter posting.

* Fix test failure
  • Loading branch information
katieby authored and sarken committed Sep 19, 2017
1 parent e2032fa commit e66234a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/controllers/chapters_controller.rb
Expand Up @@ -161,6 +161,9 @@ def update
posted_changed = @chapter.posted_changed?
@work.set_revised_at_by_chapter(@chapter)
if @chapter.save && @work.save
if @chapter.posted
post_chapter
end
flash[:notice] = ts("Chapter was successfully #{posted_changed ? 'posted' : 'updated'}.")
redirect_to [@work, @chapter]
else
Expand Down
1 change: 0 additions & 1 deletion spec/controllers/chapters_controller_spec.rb
Expand Up @@ -680,7 +680,6 @@
end

it "posts the work if the work was not posted before" do
pending "multi-chapter works should post when chapter is posted"
put :update, params: { work_id: unposted_work.id, id: unposted_work.chapters.first.id, chapter: @chapter_attributes, post_button: true }
expect(assigns[:work].posted).to be true
end
Expand Down

0 comments on commit e66234a

Please sign in to comment.