discourse/lib/discourse_ip_info_spec.rb
Alan Guo Xiang Tan 9182501366
DEV: Introduce maxmind_mirror_url GlobalSetting (#26458)
Why this change?

This allows downloading the MaxMind databases from a mirror in cases
where downloading directly from MaxMind's API endpoint is problematic
due to API limits.
2024-04-02 14:53:53 +08:00

17 lines
505 B
Ruby

# frozen_string_literal: true
RSpec.describe DiscourseIpInfo do
describe ".mmdb_download" do
it "should download the MaxMind databases from the right URL when `maxmind_mirror_url` global setting has been configured" do
global_setting :maxmind_mirror_url, "https://example.com/mirror/"
stub_request(:get, "https://example.com/mirror/GeoLite2-City.tar.gz").to_return(
status: 200,
body: "",
)
described_class.mmdb_download("GeoLite2-City")
end
end
end