post replacements: add option to fix source after replacement.

Adds a "Final Source" field to the post replacement dialog. If
specified, the post's source field will be changed to this value after
replacement.

This makes fixing the source back to the HTML page after
replacement easier.
This commit is contained in:
evazion
2017-06-22 15:19:41 -05:00
parent 55512130e1
commit c27668d2ef
4 changed files with 16 additions and 4 deletions

View File

@@ -190,5 +190,15 @@ class PostReplacementTest < ActiveSupport::TestCase
assert(File.exists?(@post.large_file_path))
end
end
context "a post when given a final_source" do
should "change the source to the final_source" do
replacement_url = "http://data.tumblr.com/afed9f5b3c33c39dc8c967e262955de2/tumblr_orwwptNBCE1wsfqepo1_raw.png"
final_source = "https://noizave.tumblr.com/post/162094447052"
@post.replace!(replacement_url: replacement_url, final_source: final_source)
assert_equal(final_source, @post.source)
end
end
end
end