Stub out requests to hostip.info during tests

These are detecting the correct locale for showing terms during signup
This commit is contained in:
Andy Allan 2016-10-28 13:43:13 +01:00
parent 6bc488a983
commit d3d6e9902c
6 changed files with 19 additions and 0 deletions

View file

@ -8,6 +8,8 @@ class SiteControllerTest < ActionController::TestCase
def setup
Object.const_set("ID_KEY", client_applications(:oauth_web_app).key)
Object.const_set("POTLATCH2_KEY", client_applications(:oauth_web_app).key)
stub_request(:get, "http://api.hostip.info/country.php?ip=0.0.0.0")
end
##

View file

@ -3,6 +3,10 @@ require "test_helper"
class UserControllerTest < ActionController::TestCase
api_fixtures
setup do
stub_request(:get, "http://api.hostip.info/country.php?ip=0.0.0.0")
end
##
# test all routes which lead to this controller
def test_routes