Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yammer::ApiResponse does not report all successes as successful #48

Open
chrisbloom7 opened this issue Dec 3, 2016 · 0 comments
Open

Comments

@chrisbloom7
Copy link

Yammer::ApiResponse#success? is not consistent when reporting on the success of the request. Consider the following:

client = Yammer::Client.new(access_token: access_token) # => #<Yammer::Client:0x007f968faecd10 ...>
current_user = client.current_user # => #<Yammer::ApiResponse:0x007f968fc371e8 @body="...", @code=200, ...>
current_user.class # => Yammer::ApiResponse
current_user.code # => 200
current_user.success? # => true
activity_response = client.create_activity(activity) # => #<Yammer::ApiResponse:0x007f968ff41460 @body="...", @code=202, ...>
activity_response.class # => Yammer::ApiResponse
activity_response.code # => 202
activity_response.success? # => false

I would expect that any response in the 2xx range would report success? as true

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

No branches or pull requests

1 participant