-
-
Notifications
You must be signed in to change notification settings - Fork 934
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
prevent submission if password is not included #5250
prevent submission if password is not included #5250
Conversation
test/integration/profile_test.rb
Outdated
@@ -133,6 +133,19 @@ def sign_out | |||
assert page.has_link?("@nick1", href: "https://twitter.com/nick1") | |||
end | |||
|
|||
test "adding X(formerly Twitter) username without filling in your password" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: I need to write the test in the system folder
fullscreen_headless_chrome_driver |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5250 +/- ##
==========================================
- Coverage 96.85% 94.16% -2.70%
==========================================
Files 456 456
Lines 9529 9607 +78
==========================================
- Hits 9229 9046 -183
- Misses 300 561 +261 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good once tests are passing. Thanks you for fixing this!
test/integration/profile_test.rb
Outdated
puts page.html | ||
|
||
|
||
assert_content("please fill in your password") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not be readable by capybara because it's browser generated.
What if you click submit, comment about what's happening (browser halted submit because password is required), then filled the password and submitted again and check that the new value is saved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I had to write this as a system test rather than an integration test since the system test runs the test on actual chrome.
@martinemde Tests are passing, but looks like the build is failing is the code coverage 😅 .. but I wrote a test for the code change.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Don't worry about the project test coverage. We'll need to raise that overall across the project to get it to stop warning. It's not this commit's fault.
Tested on staging and it works great. Should be available on production soon. Thanks again @jacklynhma and happy to work with you again at the conference. |
Thanks @martinemde ! Happy to work with you again too :). |
PR is ready for review
Objective: Prevent the profile update form from submitting if the user forgets to add their password so they do not have to fill the form out again.
Old behavior:
New Behavior:
More context: This PR opened during the Ruby Conf Hack day. Thanks @martinemde for suggesting this fix :).