Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

test/tc_gdata_client_calendar fails #12

Open
GoogleCodeExporter opened this issue Aug 13, 2015 · 1 comment
Open

test/tc_gdata_client_calendar fails #12

GoogleCodeExporter opened this issue Aug 13, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create a test_config.yml: the username and password should be for a
*GOOGLE APPS* user, e.g., [email protected] (NOT [email protected])
2. ruby test/tc_gdata_client_calendar.rb


What is the expected output? PASS What do you see instead?

FAIL:

  1) Failure:
test_get_all_calendars(TC_GData_Client_Calendar)
[test/tc_gdata_client_calendar.rb:29]:
Must not be a redirect.
<200> expected but was
<302>.

What version of the product are you using? On what operating system?

gdata-ruby-util: 1.1.1
Ruby 1.8.6 (fails on hoang's version for 1.9.1, too --
http://code.google.com/u/hoanga/)
OS/X 10.5


Please provide any additional information below.

I don't understand the redirect strategy in general. I could patch the
library to follow the redirect, but am not sure if this is the best strategy.

Original issue reported on code.google.com by [email protected] on 29 Apr 2010 at 2:34

@GoogleCodeExporter
Copy link
Author

P.S. I think the reason this is broken is because
GData::Client::Calendar#make_request is obviously wrong.

It claims to want to do a redirect, but the new request is to the exact same 
original
url.

      def make_request(method, url, body = '', retries = 4)
        response = super(method, url, body)
        if response.status_code == 302 and retries > 0
          @session_cookie = response.headers['set-cookie']
          return self.make_request(method, url, body, 
            retries - 1)
        else
          return response
        end
      end

E.g., should be something like

          @session_cookie = response.headers['set-cookie']
          redirect_url = response.headers['location']
          return self.make_request(method, redirect_url, body, 
            retries - 1)

Original comment by [email protected] on 29 Apr 2010 at 2:52

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant