update tests
This commit is contained in:
@@ -28,8 +28,7 @@ class PostTest < ActiveSupport::TestCase
|
||||
context "Deletion:" do
|
||||
context "Expunging a post" do
|
||||
setup do
|
||||
@upload = FactoryBot.create(:jpg_upload)
|
||||
@upload.process!
|
||||
@upload = UploadService.new(FactoryBot.attributes_for(:jpg_upload)).start!
|
||||
@post = @upload.post
|
||||
Favorite.add(post: @post, user: @user)
|
||||
end
|
||||
@@ -2677,4 +2676,19 @@ class PostTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "#replace!" do
|
||||
subject { @post.replace!(tags: "something", replacement_url: "https://danbooru.donmai.us/data/preview/download.png") }
|
||||
|
||||
setup do
|
||||
@post = FactoryBot.create(:post)
|
||||
@post.stubs(:queue_delete_files)
|
||||
end
|
||||
|
||||
should "update the post" do
|
||||
assert_changes(-> { @post.md5 }) do
|
||||
subject
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user