iqdb fixes
This commit is contained in:
@@ -12,7 +12,7 @@ class IqdbProxy
|
|||||||
def self.decorate_posts(json)
|
def self.decorate_posts(json)
|
||||||
json.map do |x|
|
json.map do |x|
|
||||||
begin
|
begin
|
||||||
x["post"] = Post.find(x["id"])
|
x["post"] = Post.find(x["post_id"])
|
||||||
x
|
x
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
nil
|
nil
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class IqdbQueriesControllerTest < ActionDispatch::IntegrationTest
|
|||||||
@params = { url: @url }
|
@params = { url: @url }
|
||||||
@mocked_response = [{
|
@mocked_response = [{
|
||||||
"post" => @posts[0],
|
"post" => @posts[0],
|
||||||
"id" => @posts[0].id,
|
"post_id" => @posts[0].id,
|
||||||
"score" => 1
|
"score" => 1
|
||||||
}]
|
}]
|
||||||
end
|
end
|
||||||
@@ -35,7 +35,7 @@ class IqdbQueriesControllerTest < ActionDispatch::IntegrationTest
|
|||||||
@url = @posts[0].preview_file_url
|
@url = @posts[0].preview_file_url
|
||||||
@mocked_response = [{
|
@mocked_response = [{
|
||||||
"post" => @posts[0],
|
"post" => @posts[0],
|
||||||
"id" => @posts[0].id,
|
"post_id" => @posts[0].id,
|
||||||
"score" => 1
|
"score" => 1
|
||||||
}]
|
}]
|
||||||
end
|
end
|
||||||
@@ -49,7 +49,7 @@ class IqdbQueriesControllerTest < ActionDispatch::IntegrationTest
|
|||||||
|
|
||||||
context "with matches" do
|
context "with matches" do
|
||||||
setup do
|
setup do
|
||||||
json = @posts.map {|x| {"id" => x.id, "score" => 1}}.to_json
|
json = @posts.map {|x| {"post_id" => x.id, "score" => 1}}.to_json
|
||||||
@params = { matches: json }
|
@params = { matches: json }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user