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")
+ stub_signup_requests
end
##
api_fixtures
setup do
- stub_request(:get, "http://api.hostip.info/country.php?ip=0.0.0.0")
+ stub_signup_requests
end
##
include OAuth::Helper
setup do
- stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1")
+ stub_signup_requests
end
def test_oauth10_web_app
def setup
I18n.locale = "en"
- stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1")
+ stub_signup_requests
end
def teardown
fixtures :users, :user_roles
setup do
- stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1")
+ stub_signup_requests
end
test "grant" do
fixtures :users
setup do
- stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1")
+ stub_signup_requests
end
def test_api_blocked
url = "https://www.gravatar.com/avatar/#{hash}?d=404"
stub_request(:get, url).and_return(:status => status, :body => body)
end
+
+ def stub_signup_requests
+ # Controller tests and integration tests use different IPs
+ stub_request(:get, "http://api.hostip.info/country.php?ip=0.0.0.0")
+ stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1")
+ end
end
end