X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/feb3b03227dae5e41e631b1df90afc879355617d..90175c3bdbc1b25eab177dc2d019b86d2854f9a7:/test/controllers/user_controller_test.rb diff --git a/test/controllers/user_controller_test.rb b/test/controllers/user_controller_test.rb index 8c88615a7..ef4bd0fff 100644 --- a/test/controllers/user_controller_test.rb +++ b/test/controllers/user_controller_test.rb @@ -2,7 +2,11 @@ require "test_helper" class UserControllerTest < ActionController::TestCase api_fixtures - fixtures :messages + + setup do + stub_request(:get, "http://api.hostip.info/country.php?ip=0.0.0.0") + stub_request(:get, /.*gravatar.com.*d=404/).to_return(:status => 404) + end ## # test all routes which lead to this controller @@ -924,6 +928,7 @@ class UserControllerTest < ActionController::TestCase end # Test a user who has been blocked + create(:user_block, :user => users(:blocked_user)) get :view, :display_name => "blocked" assert_response :success assert_select "div#userinformation" do @@ -938,6 +943,7 @@ class UserControllerTest < ActionController::TestCase end # Test a moderator who has applied blocks + create(:user_block, :creator => users(:moderator_user)) get :view, :display_name => "moderator" assert_response :success assert_select "div#userinformation" do @@ -1034,6 +1040,8 @@ class UserControllerTest < ActionController::TestCase end def test_api_details + create(:message, :read, :recipient => users(:normal_user)) + # check that nothing is returned when not logged in get :api_details assert_response :unauthorized