...@@ -9,6 +9,7 @@ class Project < ApplicationRecord ...@@ -9,6 +9,7 @@ class Project < ApplicationRecord
include AccessRequestable include AccessRequestable
include Avatarable include Avatarable
include CacheMarkdownField include CacheMarkdownField
include IgnorableColumn
include Referable include Referable
include Sortable include Sortable
include AfterCommitQueue include AfterCommitQueue
...@@ -55,6 +56,8 @@ class Project < ApplicationRecord ...@@ -55,6 +56,8 @@ class Project < ApplicationRecord
VALID_MIRROR_PORTS = [22, 80, 443].freeze VALID_MIRROR_PORTS = [22, 80, 443].freeze
VALID_MIRROR_PROTOCOLS = %w(http https ssh git).freeze VALID_MIRROR_PROTOCOLS = %w(http https ssh git).freeze
ignore_column :import_status, :import_jid, :import_error
cache_markdown_field :description, pipeline: :description cache_markdown_field :description, pipeline: :description
delegate :feature_available?, :builds_enabled?, :wiki_enabled?, delegate :feature_available?, :builds_enabled?, :wiki_enabled?,
... ...
......
...@@ -47,17 +47,12 @@ describe RegistrationsController do ...@@ -47,17 +47,12 @@ describe RegistrationsController do
end end
context 'when reCAPTCHA is enabled' do context 'when reCAPTCHA is enabled' do
def fail_recaptcha
# Without this, `verify_recaptcha` arbitrarily returns true in test env
Recaptcha.configuration.skip_verify_env.delete('test')
end
before do before do
stub_application_setting(recaptcha_enabled: true) stub_application_setting(recaptcha_enabled: true)
end end
it 'displays an error when the reCAPTCHA is not solved' do it 'displays an error when the reCAPTCHA is not solved' do
fail_recaptcha allow_any_instance_of(described_class).to receive(:verify_recaptcha).and_return(false)
post(:create, params: user_params) post(:create, params: user_params)
...@@ -78,7 +73,6 @@ describe RegistrationsController do ...@@ -78,7 +73,6 @@ describe RegistrationsController do
it 'does not require reCAPTCHA if disabled by feature flag' do it 'does not require reCAPTCHA if disabled by feature flag' do
stub_feature_flags(registrations_recaptcha: false) stub_feature_flags(registrations_recaptcha: false)
fail_recaptcha
post(:create, params: user_params) post(:create, params: user_params)
... ...
......