Help page seeds should only overwrite posts that have not been edited through the user interface #992
Labels
complexity: unassessed
Needs further developer investigation before complexity/feasibility can be determined.
priority: high
type: bug
Something isn't working
Describe the bug
Before merging #988 we need to be sure that running
UPDATE_POSTS=true rails db:seed
from the terminal will only overwrite posts (help page content) that have not already been edited through the user interface.At present it appears that this overwriting is only prevented when the edit includes text outside HTML tags. This means that an admin could edit a help page to add a sentence in a
<p>
tag (contained within<p>
and</p>
) and this would not be detected as something to avoid overwriting.To Reproduce
Steps to reproduce the behavior: (in a local development environment)
UPDATE_POSTS=true rails db:seed
and note how many posts are listed as having been updated:example text
that is outside all HTML tagsUPDATE_POSTS=true rails db:seed
and note how many posts are listed as having been updated:example text
(as intended)<p>example text</p>
(this time contained in a<p>
tag)UPDATE_POSTS=true rails db:seed
and note how many posts are listed as having been updated:<p>example text</p>
(which is incorrect behaviour)Expected behavior
When running
UPDATE_POSTS=true rails db:seed
only posts that have never been edited through the user interface should be updated. This should apply equally regardless of the nature of the edit (HTML/not).The text was updated successfully, but these errors were encountered: