diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index 61e6ad43a02..bade7193ed3 100755 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -405,6 +405,8 @@ def update_tags @work.posted = true @work.minor_version = @work.minor_version + 1 @work.save + @work.word_count = @work.first_chapter.word_count + @work.save flash[:notice] = ts('Work was successfully updated.') redirect_to(@work) end diff --git a/features/works/work_edit_tags.feature b/features/works/work_edit_tags.feature index 73fad2066c1..acd503ad856 100644 --- a/features/works/work_edit_tags.feature +++ b/features/works/work_edit_tags.feature @@ -52,6 +52,21 @@ Feature: Edit tags on a work And I should see "Anthropomorphic" And I should see "The cooler version of tag" + Scenario: See correct word count when posting draft from Edit Tags + Given I am logged in as "imit" with password "tagyoure" + And the draft "Freeze Tag" + When I am on imit's works page + Then I should see "Drafts (1)" + When I follow "Drafts (1)" + Then I should see "Freeze Tag" + And I should see "Edit Tags" within "#main .own.work.blurb .actions" + When I follow "Edit Tags" + Then I should see "Post" + When I press "Post" + Then I should see "Work was successfully updated." + And I should not see "This work is a draft and has not been posted" + And I should see "Words:6" + Scenario: Ampersands and angle brackets should display in work titles on Edit Tags page Given the work "I am <strong>er Than Yesterday & Other Lies" by "testuser2" And I am logged in as "testuser2"