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

add url validation to commit model #142

Merged
merged 1 commit into from Feb 21, 2016

Conversation

lalithr95
Copy link
Contributor

URL validation is done through URI regex and necessary tests are also listed

@@ -25,4 +25,21 @@ class CommitTest < ActiveSupport::TestCase
commit = create(:commit, sha1: '1234567')
assert_includes commit.version, '12345'
end

test "validates valid URL" do
valid_url = ['https://github.com/ruby-bench/ruby-bench-web/blob/master/app/models/commit.rb',
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick here: I prefer

valid_url = [
  'https://...',
  'http://...'
]

😄

@tgxworld
Copy link
Member

PR looks good to me :) 👍

@lalithr95
Copy link
Contributor Author

@tgxworld updated changes 😃

tgxworld added a commit that referenced this pull request Feb 21, 2016
add url validation to commit model
@tgxworld tgxworld merged commit b45988a into ruby-bench:master Feb 21, 2016
@tgxworld
Copy link
Member

👍

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