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

Rename user factory to doorkeeper_testing_user #871

Closed

Conversation

jormon
Copy link
Contributor

@jormon jormon commented Aug 5, 2016

Developers of Rails applications love to include the factories from the doorkeeper gem into their applications because the factories make it easy to do feature testing of the API, stubbing out the relevant doorkeeper models.

However, there is a name conflict on the user factory (which is a global namespace), so that developers cannot include <path_to_doorkeeper>/spec/factories.rb if their own factories.rb includes a :user factory (which most do).

This change simply renames the internal factory (which is only used in 1 test anyways) to a scoped name that is much less likely to conflict. It does not change which class the factory is modeled off of (still the user.rb in the dummy spec app).

Developers of Rails applications love to include the factories from the doorkeeper gem into their applications because the factories make it easy to do feature testing of the API, stubbing out the relevant doorkeeper models.

However, there is a name conflict on the user factory (which is a global namespace), so that developers cannot include `<path_to_doorkeeper>/spec/factories.rb` if their own factories.rb includes a :user factory (which most do).

This change simply renames the internal factory (which is only used in 1 test anyways) to a scoped name that is much less likely to conflict.  It does not change which class the factory is modeled off of (still the user.rb in the dummy spec app).
@jormon
Copy link
Contributor Author

jormon commented Aug 5, 2016

related to #55

jormon referenced this pull request Aug 5, 2016
FactoryGirl does it in one line.
@tute tute closed this in 16bb66e Aug 7, 2016
@tute
Copy link
Contributor

tute commented Aug 7, 2016

Merged into master. Thank you! :)

@jormon jormon deleted the rename-user-factory branch September 28, 2016 01:07
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

Successfully merging this pull request may close these issues.

None yet

2 participants