diff --git a/CHECKS b/CHECKS index 223e5a175..24d7a521f 100644 --- a/CHECKS +++ b/CHECKS @@ -1,4 +1,4 @@ WAIT=10 -ATTEMPTS=20 +ATTEMPTS=300 /users/sign_in Sign in to diff --git a/Gemfile b/Gemfile index 5a42c21fe..b80ae29ee 100644 --- a/Gemfile +++ b/Gemfile @@ -124,8 +124,6 @@ group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' - # Easy installation and use of chromedriver to run system tests with Chrome - gem 'chromedriver-helper' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/Gemfile.lock b/Gemfile.lock index b01261f5d..f310deea9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,8 +48,6 @@ GEM railties (>= 5.0) zeitwerk ansi (1.5.0) - archive-zip (0.12.0) - io-like (~> 0.3.0) arel (9.0.0) audited (4.9.0) activerecord (>= 4.2, < 6.1) @@ -102,9 +100,6 @@ GEM xpath (~> 3.2) chartkick (3.4.0) childprocess (3.0.0) - chromedriver-helper (2.1.1) - archive-zip (~> 0.10) - nokogiri (~> 1.8) codeclimate-test-reporter (0.6.0) simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.3) @@ -197,7 +192,6 @@ GEM multi_xml (>= 0.5.2) i18n (1.8.5) concurrent-ruby (~> 1.0) - io-like (0.3.1) jmespath (1.4.0) jquery-rails (4.4.0) rails-dom-testing (>= 1, < 3) @@ -449,7 +443,6 @@ DEPENDENCIES byebug capybara (>= 2.15) chartkick (~> 3.4) - chromedriver-helper codeclimate-test-reporter (~> 0.6.0) devise (~> 4.7) devise-doorkeeper diff --git a/app/models/questionnaire.rb b/app/models/questionnaire.rb index 5407edf57..ad8c2f488 100644 --- a/app/models/questionnaire.rb +++ b/app/models/questionnaire.rb @@ -43,7 +43,10 @@ class Questionnaire < ApplicationRecord validates :portfolio_url, url: { allow_blank: true } validates :vcs_url, url: { allow_blank: true } - 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" + validates_format_of :vcs_url, + with: %r{\A((https?:\/\/)?(www\.)?((github\.com)|(gitlab\.com)|(bitbucket\.org))\/(.*){0,62})\z}i, + allow_blank: true, + message: "Must be a GitHub, GitLab or Bitbucket url" strip_attributes POSSIBLE_EXPERIENCES = { @@ -129,11 +132,13 @@ def email end def portfolio_url=(value) + value = value.downcase unless value.blank? value = "http://" + value if !value.blank? && !value.include?("http://") && !value.include?("https://") super value end def vcs_url=(value) + value = value.downcase unless value.blank? value = "https://" + value if !value.blank? && !value.include?("http://") && !value.include?("https://") super value end diff --git a/test/models/questionnaire_test.rb b/test/models/questionnaire_test.rb index d1ac8764b..7cf590185 100644 --- a/test/models/questionnaire_test.rb +++ b/test/models/questionnaire_test.rb @@ -103,6 +103,8 @@ class QuestionnaireTest < ActiveSupport::TestCase should allow_value('foo.com').for(:portfolio_url) should allow_value('github.com/foo', 'gitlab.com/bar', 'bitbucket.org/baz').for(:vcs_url) should allow_value('https://github.com/foo', 'https://gitlab.com/bar', 'https://bitbucket.org/baz').for(:vcs_url) + should allow_value('HttPs://gITHub.CoM/foo', 'hTTp://gitLAB.coM/bar').for(:vcs_url) + should allow_value('wWw.gITHub.CoM/fOo', 'hTTp://wWw.gitLAB.coM/f-fc-vx').for(:vcs_url) should_not allow_value('http://foo.com', 'https://bar.com').for(:vcs_url) context "#school" do diff --git a/vendor/cache/archive-zip-0.12.0.gem b/vendor/cache/archive-zip-0.12.0.gem deleted file mode 100644 index 7e171f3d5..000000000 Binary files a/vendor/cache/archive-zip-0.12.0.gem and /dev/null differ diff --git a/vendor/cache/chromedriver-helper-2.1.1.gem b/vendor/cache/chromedriver-helper-2.1.1.gem deleted file mode 100644 index c5de7290b..000000000 Binary files a/vendor/cache/chromedriver-helper-2.1.1.gem and /dev/null differ diff --git a/vendor/cache/io-like-0.3.1.gem b/vendor/cache/io-like-0.3.1.gem deleted file mode 100644 index ffce952b5..000000000 Binary files a/vendor/cache/io-like-0.3.1.gem and /dev/null differ