livingsocial/rails-googleapps-auth — pull request #2 by amateurhuman (2012-08-17 19:05:25+00:00)
Title: Fix google apps auth finish when attrs empty

If ````google_apps_auth_begin```` is not passed an ````attrs```` array, then the response from ````OpenID::AX::FetchResponse.from_success_response```` is ````nil```` (and therefore does not have any ````data```` to receive.

The README indicates that you can exclude ````attrs```` from ````google_apps_auth_begin````, and I agree that it shouldn't be a required parameter.

The original test mocked the oid_response to return an object with an empty data hash, therefore not catching this scenario. I've modified that test to return mock data as well as added a test where no data hash is returned.

I think the root of the problem is ````ruby-openid```` which returns ````nil```` from ````FetchResponse.from_success_response```` on any error, which you can [see here](https://github.com/openid/ruby-openid/blob/master/lib/openid/extensions/ax.rb#L473-490). This patch should still work once the problem in ````ruby-openid```` can be sorted out.