additional spec fixes

This commit is contained in:
Albert Yi
2018-09-04 14:01:35 -07:00
parent 13c2b4f5d0
commit 30a5d745a0
2 changed files with 2 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ module TagAutocomplete
def count_sort(query, words)
words.uniq.slice(0, LIMIT).sort_by do |x|
x.post_count * x.weight
x.post_count.to_i * x.weight
end.reverse
end

View File

@@ -35,7 +35,7 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
context "preprocess action" do
should "prefer the file over the source when preprocessing" do
file = Rack::Test::UploadedFile.new("#{Rails.root}/test/files/test.jpg", "image/jpeg")
post_auth preprocess_uploads_path, @user, params: {:url => "https://raikou1.donmai.us/d3/4e/d34e4cf0a437a5d65f8e82b7bcd02606.jpg", :file => file}
post_auth preprocess_uploads_path, @user, params: {:upload => {:source => "https://raikou1.donmai.us/d3/4e/d34e4cf0a437a5d65f8e82b7bcd02606.jpg", :file => file}}
assert_response :success
Delayed::Worker.new.work_off
assert_equal("ecef68c44edb8a0d6a3070b5f8e8ee76", Upload.last.md5)