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

Added integration tests of the password reset process #205

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jhsu802701
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Feb 5, 2019

Coverage Status

Coverage increased (+3.7%) to 56.167% when pulling 35c82a8 on jhsu802701:pr_password_reset_tests into a454e3d on minnestar:master.

Copy link
Member

@caseyhelbling caseyhelbling left a comment

Choose a reason for hiding this comment

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

Good find on capybara-email. Couple nits and one request. Thanks!


scenario 'Participant can reset password' do
# Event needed until Pull Request #202 is merged into the code base
Event.create!(name: 'Event 1', date: Time.now)
Copy link
Member

Choose a reason for hiding this comment

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

Why not extract this to a let ?

click_button 'Reset Password'
assert page.has_text?('No participant was found with email address not_exist@example.com')

# Enter a valid email address
Copy link
Member

Choose a reason for hiding this comment

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

I'd make each one of these individual example blocks. it "enters a valid email address" do etc...

assert page.has_text?('Instructions to reset your password have been emailed to you')

# Open and follow instructions
open_email(user.email)
Copy link
Member

Choose a reason for hiding this comment

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

Ohhh I didnt know about this... I like it.

assert page.has_css?('h1', text: 'Update your password')
assert page.has_text?('Please enter the new password below')
fill_in('password', with: 'MN Tech Community')
sleep 4.1
Copy link
Member

Choose a reason for hiding this comment

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

We'll want to remove this. If you specify a find('.some-selector.or-whatever', wait: 4) you can specify a default max wait time. You might want to check but it might already be 5 or more seconds.

Copy link
Member

Choose a reason for hiding this comment

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

I believe this is the only substantial change requested. I'd be happy to merge this if we can remove the sleep call.

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.

3 participants