post replacements: allow replacing with an uploaded file.
This commit is contained in:
@@ -191,6 +191,18 @@ class PostReplacementTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
context "a post with an uploaded file" do
|
||||
should "work" do
|
||||
Tempfile.open do |file|
|
||||
file.write(File.read("#{Rails.root}/test/files/test.png"))
|
||||
file.seek(0)
|
||||
|
||||
@post.replace!(replacement_file: file, replacement_url: "")
|
||||
assert_equal(@post.md5, Digest::MD5.file(file).hexdigest)
|
||||
end
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user