songkick / oauth2-provider

Simple OAuth 2.0 provider toolkit
MIT License
528 stars 148 forks source link

Fix bug in find_or_create_for_client #40

Closed dplummer closed 12 years ago

dplummer commented 12 years ago

The test was failing because a validation was failing on the authorization generated by find_or_create_by_client_id. The reason is that you validate_presence_of :client, but you are doing find_or_create_by_client_id, so the :client attribute is not set and validation fails.

Solution is to just set the client and owner in the find_or_create block that ActiveRecord provides.

travisbot commented 12 years ago

This pull request fails (merged 298ae6a6 into eccb7c7d).

jcoglan commented 12 years ago

This test is deliberately failing at the moment as part of working out another pull request. Thanks for spotting and helping, though.