post replacements: refactor and fix tests.

* Move replacement tests from test/unit/upload_service_test.rb to
  test/functional/post_replacement_controller_test.rb
* Move UploadService::Replacer to PostReplacementProcessor.
* Fix a minor bug where if you used the API to replace a post with a file,
  the replacement would fail unless you passed an empty string for the
  replacement_url.
This commit is contained in:
evazion
2022-01-31 12:14:06 -06:00
parent 61c043c6b1
commit 65b7c08e33
9 changed files with 239 additions and 432 deletions

View File

@@ -3,5 +3,6 @@ FactoryBot.define do
post factory: :post, source: FFaker::Internet.http_url
original_url { FFaker::Internet.http_url }
replacement_url { FFaker::Internet.http_url }
creator
end
end