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
##
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
include OAuth::Helper
+ setup do
+ stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1")
+ end
+
def test_oauth10_web_app
client = client_applications(:oauth_web_app)
def setup
I18n.locale = "en"
+ stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1")
end
def teardown
class UserRolesTest < ActionDispatch::IntegrationTest
fixtures :users, :user_roles
+ setup do
+ stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1")
+ end
+
test "grant" do
check_fail(:grant, :public_user, :moderator)
check_fail(:grant, :moderator_user, :moderator)
class UserTermsSeenTest < ActionDispatch::IntegrationTest
fixtures :users
+ setup do
+ stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1")
+ end
+
def test_api_blocked
with_terms_seen(true) do
user = users(:terms_not_seen_user)