Skip to content

Commit 2b14f72

Browse files
peterkosJeremyRudmancbaudouinjr
authored
master <- develop (2.1.3) (#489)
* fix(questionnaire): missing information now in correct place (#443) * fix(questionnair): missing information now in correct place it now displays the correct message "Please read & accept" instead of missing information and the notification is now in the correct place * Update app/assets/javascripts/validate.js * Revert "Update app/assets/javascripts/validate.js" This reverts commit bc54783. Signed-off-by: Peter Kos <[email protected]> Co-authored-by: Peter Kos <[email protected]> * fix: Fixes mobile agreements layout bug Signed-off-by: Peter Kos <[email protected]> * feat: Removes semantic-release (#446) * refactor: Moves CI to develop branch (#449) Co-authored-by: Peter Kos <[email protected]> * build: Merges 2.1.2 into develop * fix(hakiri): corrected unescaped model attribute * fix(hakiri): added html_safe to show proper output Co-authored-by: Jeremy Rudman <[email protected]> Co-authored-by: JeremyRudman <[email protected]> * fix: Shows questionnaires_closed_message on registration * feat: Allows agreements to be fully customizable (#465) * feat: Allows agreements to be fully customizable * fix: Fixes broken migrations * fix: Migrations misname issue * feat: Forces agreement links to open in new tab * Agreement validation detection fixed Signed-off-by: Peter Kos <[email protected]> * refactor: Removes old input hint Co-authored-by: Peter Kos <[email protected]> * fix(hakiri): fixed un-escaped regex for vcs link (#467) * fix(hakiri): corrected unescaped model attribute * fix(hakiri): added html_safe to show proper output * fix(hakiri): added \A \z to regex * fix(questionnaire): fixed hakiri error with vcs link regex * fix(questionnaire): fixed houndci commplaint Co-authored-by: Chris Baudouin, Jr <[email protected]> * fix(hakiri): fix hakiri error with user input in html_safe (#475) Co-authored-by: Peter Kos <[email protected]> * fix: Uninstalls deprecated chromedriver (#484) * fix: VCS regex matches all valid usernames for each provider; URLs are now case-insensitive, dokku check extended (#485) * fixed vcs regex to allow upper case added a extra test to vcs links to test upper case links. also made it so portfolio links ands vcs links are stored in lower case * fixed houndci complaints * lossened username regex and add another test * made regex more pleasing to read * made regex method more readable * checks now does 300 attempts Co-authored-by: JeremyRudman <[email protected]> Co-authored-by: Chris Baudouin, Jr <[email protected]> Co-authored-by: Jeremy Rudman <[email protected]>
1 parent 4923231 commit 2b14f72

File tree

8 files changed

+9
-11
lines changed

8 files changed

+9
-11
lines changed

CHECKS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
WAIT=10
2-
ATTEMPTS=20
2+
ATTEMPTS=300
33

44
/users/sign_in Sign in to

Gemfile

-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ group :test do
124124
# Adds support for Capybara system testing and selenium driver
125125
gem 'capybara', '>= 2.15'
126126
gem 'selenium-webdriver'
127-
# Easy installation and use of chromedriver to run system tests with Chrome
128-
gem 'chromedriver-helper'
129127
end
130128

131129
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem

Gemfile.lock

-7
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ GEM
4848
railties (>= 5.0)
4949
zeitwerk
5050
ansi (1.5.0)
51-
archive-zip (0.12.0)
52-
io-like (~> 0.3.0)
5351
arel (9.0.0)
5452
audited (4.9.0)
5553
activerecord (>= 4.2, < 6.1)
@@ -102,9 +100,6 @@ GEM
102100
xpath (~> 3.2)
103101
chartkick (3.4.0)
104102
childprocess (3.0.0)
105-
chromedriver-helper (2.1.1)
106-
archive-zip (~> 0.10)
107-
nokogiri (~> 1.8)
108103
codeclimate-test-reporter (0.6.0)
109104
simplecov (>= 0.7.1, < 1.0.0)
110105
coderay (1.1.3)
@@ -197,7 +192,6 @@ GEM
197192
multi_xml (>= 0.5.2)
198193
i18n (1.8.5)
199194
concurrent-ruby (~> 1.0)
200-
io-like (0.3.1)
201195
jmespath (1.4.0)
202196
jquery-rails (4.4.0)
203197
rails-dom-testing (>= 1, < 3)
@@ -449,7 +443,6 @@ DEPENDENCIES
449443
byebug
450444
capybara (>= 2.15)
451445
chartkick (~> 3.4)
452-
chromedriver-helper
453446
codeclimate-test-reporter (~> 0.6.0)
454447
devise (~> 4.7)
455448
devise-doorkeeper

app/models/questionnaire.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ class Questionnaire < ApplicationRecord
4343

4444
validates :portfolio_url, url: { allow_blank: true }
4545
validates :vcs_url, url: { allow_blank: true }
46-
validates_format_of :vcs_url, with: %r{\A(((https?:\/\/)?(www\.)?github\.com\/\w+\/?)|((https?:\/\/)?(www\.)?gitlab\.com\/\w+\/?)|((https?:\/\/)?(www\.)?bitbucket\.org\/\w+\/?))\z}, allow_blank: true, message: "Must be a GitHub, GitLab or Bitbucket url"
46+
validates_format_of :vcs_url,
47+
with: %r{\A((https?:\/\/)?(www\.)?((github\.com)|(gitlab\.com)|(bitbucket\.org))\/(.*){0,62})\z}i,
48+
allow_blank: true,
49+
message: "Must be a GitHub, GitLab or Bitbucket url"
4750
strip_attributes
4851

4952
POSSIBLE_EXPERIENCES = {
@@ -129,11 +132,13 @@ def email
129132
end
130133

131134
def portfolio_url=(value)
135+
value = value.downcase unless value.blank?
132136
value = "http://" + value if !value.blank? && !value.include?("http://") && !value.include?("https://")
133137
super value
134138
end
135139

136140
def vcs_url=(value)
141+
value = value.downcase unless value.blank?
137142
value = "https://" + value if !value.blank? && !value.include?("http://") && !value.include?("https://")
138143
super value
139144
end

test/models/questionnaire_test.rb

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ class QuestionnaireTest < ActiveSupport::TestCase
103103
should allow_value('foo.com').for(:portfolio_url)
104104
should allow_value('github.com/foo', 'gitlab.com/bar', 'bitbucket.org/baz').for(:vcs_url)
105105
should allow_value('https://github.com/foo', 'https://gitlab.com/bar', 'https://bitbucket.org/baz').for(:vcs_url)
106+
should allow_value('HttPs://gITHub.CoM/foo', 'hTTp://gitLAB.coM/bar').for(:vcs_url)
107+
should allow_value('wWw.gITHub.CoM/fOo', 'hTTp://wWw.gitLAB.coM/f-fc-vx').for(:vcs_url)
106108
should_not allow_value('http://foo.com', 'https://bar.com').for(:vcs_url)
107109

108110
context "#school" do

vendor/cache/archive-zip-0.12.0.gem

-57.5 KB
Binary file not shown.
-20 KB
Binary file not shown.

vendor/cache/io-like-0.3.1.gem

-33.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)