mod dashboard: remove ip address search.

Remove the IP address search option from the /moderator/dashboard page.
This was an obsolete way of searching for sockpuppet accounts by IP.
The /user_events page should be used instead.
This commit is contained in:
evazion
2022-09-12 23:43:56 -05:00
parent fb980d4a16
commit e2a3265daf
14 changed files with 0 additions and 242 deletions

View File

@@ -1,32 +0,0 @@
require 'test_helper'
module Moderator
class IpAddrsControllerTest < ActionDispatch::IntegrationTest
context "The ip addrs controller" do
setup do
@user = create(:moderator_user, created_at: 1.month.ago)
as(@user) { create(:comment, creator: @user) }
end
should "find by ip addr" do
get_auth moderator_ip_addrs_path, @user, params: {:search => {:ip_addr => "127.0.0.1"}}
assert_response :success
end
should "find by user id" do
get_auth moderator_ip_addrs_path, @user, params: {:search => {:user_id => @user.id.to_s}}
assert_response :success
end
should "find by user name" do
get_auth moderator_ip_addrs_path, @user, params: {:search => {:user_name => @user.name}}
assert_response :success
end
should "render the search page" do
get_auth search_moderator_ip_addrs_path, @user
assert_response :success
end
end
end
end

View File

@@ -1,26 +0,0 @@
require "test_helper"
module Moderator
class IpAddrSearchTest < ActiveSupport::TestCase
context "an ip addr search" do
setup do
@user = create(:user, last_ip_addr: "127.0.0.1")
end
should "find by ip addr" do
@search = IpAddrSearch.new(:ip_addr => "127.0.0.1")
assert_equal({@user => 1}, @search.execute)
end
should "find by user id" do
@search = IpAddrSearch.new(:user_id => @user.id.to_s)
assert_equal({IPAddr.new("127.0.0.1") => 1}, @search.execute)
end
should "find by user name" do
@search = IpAddrSearch.new(:user_name => @user.name)
assert_equal({IPAddr.new("127.0.0.1") => 1}, @search.execute)
end
end
end
end