- # Use a url with an invalid protocol to make sure it handles that correctly too
- post "/login", "openid_url" => "htt://localhost:1123/john.doe", :referer => "/diary"
+ post "/login", "openid_url" => "http://localhost:1123/john.doe", :referer => "/history"
+ assert_response :redirect
+ assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/john.doe", :origin => "/login")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_success_path(:provider => "openid", :openid_url => "http://localhost:1123/john.doe", :origin => "/login")
+ follow_redirect!
+ assert_response :redirect
+ assert_redirected_to auth_failure_path(:strategy => "openid", :message => "invalid_credentials", :origin => "/login")
+ follow_redirect!