forked from e621ng/e621ng
[Posts] Fix the iqdb remove job
More faraday fallout. For delete requests, it expects this parameter to be iterable (if present)
This commit is contained in:
parent
c60ee96133
commit
d7ece18a1c
@ -15,9 +15,9 @@ module IqdbProxy
|
||||
endpoint.present?
|
||||
end
|
||||
|
||||
def make_request(path, request_type, params = {})
|
||||
def make_request(path, request_type, body = nil)
|
||||
conn = Faraday.new(Danbooru.config.faraday_options)
|
||||
conn.send(request_type, endpoint + path, params.to_json, { content_type: "application/json" })
|
||||
conn.send(request_type, endpoint + path, body&.to_json, { content_type: "application/json" })
|
||||
rescue Faraday::Error
|
||||
raise Error, "This service is temporarily unavailable. Please try again later."
|
||||
end
|
||||
|
@ -64,8 +64,9 @@ class PostTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
should "remove the post from iqdb" do
|
||||
@post.expects(:remove_iqdb_async).once
|
||||
@post.expunge!
|
||||
request_stub = stub_request(:delete, "#{IqdbProxy.endpoint}/images/#{@post.id}")
|
||||
with_inline_jobs { @post.expunge! }
|
||||
assert_requested request_stub
|
||||
end
|
||||
|
||||
context "that is status locked" do
|
||||
|
Loading…
Reference in New Issue
Block a user