diff --git a/app/logical/tag_autocomplete.rb b/app/logical/tag_autocomplete.rb index c7c34f127..94469ff03 100644 --- a/app/logical/tag_autocomplete.rb +++ b/app/logical/tag_autocomplete.rb @@ -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 diff --git a/test/functional/uploads_controller_test.rb b/test/functional/uploads_controller_test.rb index cda38df26..8c147e916 100644 --- a/test/functional/uploads_controller_test.rb +++ b/test/functional/uploads_controller_test.rb @@ -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)