X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8cd08f2ce640e0b1967db489d29e3761ac63f0d7..f361c2439d0b2a9b8ac839b62a868884261e7897:/services/api/test/functional/user_sessions_controller_test.rb diff --git a/services/api/test/functional/user_sessions_controller_test.rb b/services/api/test/functional/user_sessions_controller_test.rb index 129464cf1c..66aff787bd 100644 --- a/services/api/test/functional/user_sessions_controller_test.rb +++ b/services/api/test/functional/user_sessions_controller_test.rb @@ -9,9 +9,8 @@ class UserSessionsControllerTest < ActionController::TestCase test "redirect to joshid" do api_client_page = 'http://client.example.com/home' get :login, params: {return_to: api_client_page} - assert_response :redirect - assert_equal("http://test.host/auth/joshid?return_to=%2Chttp%3A%2F%2Fclient.example.com%2Fhome", @response.redirect_url) - assert_nil assigns(:api_client) + # Not supported any more + assert_response 404 end test "send token when user is already logged in" do @@ -30,6 +29,7 @@ class UserSessionsControllerTest < ActionController::TestCase authorize_with :inactive api_client_page = 'http://client.example.com/home' get :login, params: {return_to: api_client_page} + assert_response :redirect assert_not_nil assigns(:api_client) assert_nil assigns(:api_client_auth).expires_at end @@ -40,6 +40,7 @@ class UserSessionsControllerTest < ActionController::TestCase authorize_with :inactive api_client_page = 'http://client.example.com/home' get :login, params: {return_to: api_client_page} + assert_response :redirect assert_not_nil assigns(:api_client) api_client_auth = assigns(:api_client_auth) assert_in_delta(api_client_auth.expires_at, @@ -105,9 +106,8 @@ class UserSessionsControllerTest < ActionController::TestCase Rails.configuration.Login.LoginCluster = 'zzzzz' api_client_page = 'http://client.example.com/home' get :login, params: {return_to: api_client_page} - assert_response :redirect - assert_equal("http://test.host/auth/joshid?return_to=%2Chttp%3A%2F%2Fclient.example.com%2Fhome", @response.redirect_url) - assert_nil assigns(:api_client) + # Doesn't redirect, just fail. + assert_response 404 end test "controller cannot create session without SystemRootToken" do