mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 11:12:40 +08:00
UX: Show on IP lookup if MaxMind key is missing (#18993)
as discussed in https://meta.discourse.org/t/maxminddb-not-found-error/148512/7. shows a warning to the admin if no license for maxmind is found
This commit is contained in:
@ -1680,6 +1680,8 @@ RSpec.describe Admin::UsersController do
|
||||
shared_examples "IP info retrieval possible" do
|
||||
it "retrieves IP info" do
|
||||
ip = "81.2.69.142"
|
||||
# Assign a dummy MaxMind license key, which is now checked in open_db
|
||||
global_setting "maxmind_license_key", "dummy"
|
||||
|
||||
DiscourseIpInfo.open_db(File.join(Rails.root, "spec", "fixtures", "mmdb"))
|
||||
Resolv::DNS.any_instance.stubs(:getname).with(ip).returns("ip-81-2-69-142.example.com")
|
||||
@ -1717,6 +1719,8 @@ RSpec.describe Admin::UsersController do
|
||||
|
||||
it "prevents retrieval of IP info with a 404 response" do
|
||||
ip = "81.2.69.142"
|
||||
# Assign a dummy MaxMind license key, which is now checked in open_db
|
||||
global_setting "maxmind_license_key", "dummy"
|
||||
|
||||
DiscourseIpInfo.open_db(File.join(Rails.root, "spec", "fixtures", "mmdb"))
|
||||
Resolv::DNS.any_instance.stubs(:getname).with(ip).returns("ip-81-2-69-142.example.com")
|
||||
|
Reference in New Issue
Block a user