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

User factory for user_controller tests #1488

Merged
merged 3 commits into from Mar 15, 2017

Conversation

gravitystorm
Copy link
Collaborator

This replaces the fixtures in the user_controller tests with factories.

Note that two of the tests still have explicit dependencies on the fixtures, where they are counting the total number of users in the database. But we can't remove the fixtures yet since there's still more refactoring to do.

ActionMailer::Base.deliveries.clear
end

def test_reset_password
user = create(:user)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a :pending as it was using the inactive user before and part of the test is checking that doing a password reset on a pending user activates the user as a side-effect.

@tomhughes tomhughes merged commit 8d2d6e1 into openstreetmap:master Mar 15, 2017
@gravitystorm gravitystorm deleted the user_factory_12 branch May 25, 2017 08:36
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