-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
4423 format account request org websites #4427
4423 format account request org websites #4427
Conversation
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.
Thank you! This looks pretty good from a functional p.o.v. -- one small textual change, then over to @dorner to see if there's anything we want modified from a technical/testing p.o.v.
app/models/account_request.rb
Outdated
@@ -21,6 +21,7 @@ class AccountRequest < ApplicationRecord | |||
validates :email, presence: true, uniqueness: true | |||
validates :request_details, presence: true, length: { minimum: 50 } | |||
validates :email, format: { with: URI::MailTo::EMAIL_REGEXP } | |||
validates :organization_website, format: { with: URI::DEFAULT_PARSER.make_regexp, message: "it should look like 'http://www.example.com'" }, allow_blank: true |
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.
Please remove the "it" at the beginning of the message. Thanks.
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.
Removed the "it" from the message
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.
LGTM
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, but I'd like to change the messaging to prompt for https as the default.
app/models/account_request.rb
Outdated
@@ -21,6 +21,7 @@ class AccountRequest < ApplicationRecord | |||
validates :email, presence: true, uniqueness: true | |||
validates :request_details, presence: true, length: { minimum: 50 } | |||
validates :email, format: { with: URI::MailTo::EMAIL_REGEXP } | |||
validates :organization_website, format: { with: URI::DEFAULT_PARSER.make_regexp, message: "should look like 'http://www.example.com'" }, allow_blank: true |
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.
The default should be https
, not http
. Pretty much every website in existence is on https
now.
@@ -75,7 +75,7 @@ | |||
</div> | |||
|
|||
<div class="form-inputs"> | |||
<%= f.input :organization_website %> | |||
<%= f.input :organization_website, placeholder: "http://www.example.com" %> |
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.
Ditto
Good point. I'll change that up! |
Majority of websites are now https
Updated 👍🏽 |
Thanks! |
Yeah, thank y'all as well! |
@Gabe-Torres: Your PR |
Resolves #4423
Description
This pr implements adding validation for the
organization_website
attribute within theaccount_request
model and enforces a URL format that will reduce the account acceptance process for admins. It also adds an example placeholder in the account request form to reduce confusion.Type of change
How Has This Been Tested?
organization_websites
attribute validation is now being tested within theaccount_request
model spec and enforces valid URL formats and will not validatewww.example.com
formatsit { should allow_value(Faker::Internet.url).for(:organization_website) }
it { should_not allow_value("www.example.com").for(:organization_website) }
Screenshots
Before
After