Commit c0d6aea1 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 0cae0f2f2165
......@@ -13,6 +13,7 @@ class RegistrationsController < Devise::RegistrationsController
before_action :whitelist_query_limiting, only: [:destroy]
before_action :ensure_terms_accepted,
if: -> { action_name == 'create' && Gitlab::CurrentSettings.current_application_settings.enforce_terms? }
before_action :load_recaptcha, only: :new
def new
if experiment_enabled?(:signup_flow)
......@@ -183,6 +184,10 @@ def stored_location_or_dashboard(user)
stored_location_for(user) || dashboard_projects_path
end
def load_recaptcha
Gitlab::Recaptcha.load_configurations!
end
# Part of an experiment to build a new sign up flow. Will be resolved
# with https://gitlab.com/gitlab-org/growth/engineering/issues/64
def choose_layout
......
---
# `extends` indicates the Vale extension point being used.
# Full list of styles: https://errata-ai.github.io/vale/styles/
extends: substitution
# Substitution rules can display the matched and suggested strings in the
# message shown to the user. The first use of %s prints the suggested option,
# and the second use of %s displays what was found in the text.
message: Use "%s" instead of "%s."
# Should a result be flagged as a suggestion, warning, or error?
# Results that fall below the MinAlertLevel set in
# https://gitlab.com/gitlab-org/gitlab/blob/master/.vale.ini won't be shown.
level: warning
# Should a match be case-insensitive or case-sensitive?
# Acceptable values are 'true' or 'false'
ignorecase: true
# Should this rule be limited to a specific scope? If yes, uncomment the line.
# Possible scopes: https://errata-ai.github.io/vale/formats/#available-scopes
# scope: heading
# Should this rule ignore normal word boundaries, such as \b ?
# Acceptable values are 'true' or 'false'
nonword: true
# What is the source for this rule?
link: https://about.gitlab.com/handbook/communication/#top-misused-terms
# The 'swap' section provides a list of values, one per line, in the form of
# $bad: $good
swap:
GitLabber: GitLab team member
self hosted: self-managed
self-hosted: self-managed
......@@ -24,9 +24,9 @@ other projects will continue to receive [namespace scoped `edit` level privilege
Management projects are restricted to the following:
- For project-level clusters, the management project must in the same
- For project-level clusters, the management project must be in the same
namespace (or descendants) as the cluster's project.
- For group-level clusters, the management project must in the same
- For group-level clusters, the management project must be in the same
group (or descendants) as as the cluster's group.
- For instance-level clusters, there are no such restrictions.
......
......@@ -108,6 +108,11 @@ You can use `%{ISSUE_ID}` placeholder which will be replaced by an issue iid
in the email, `%{ISSUE_PATH}` placeholder which will be replaced by
project path and the issue iid and `%{NOTE_TEXT}` placeholder which will be replaced by the note text.
### Using custom email display name
You can customize the email display name. Emails sent from Service Desk will have
this name in the `From` header. The default display name is `GitLab Support Bot`.
## Using Service Desk
### As an end user (issue creator)
......
# frozen_string_literal: true
require 'spec_helper'
describe Spam::HamService do
let_it_be(:user) { create(:user) }
let!(:spam_log) { create(:spam_log, user: user, submitted_as_ham: false) }
let(:fake_akismet_service) { double(:akismet_service) }
subject { described_class.new(spam_log) }
before do
allow(Spam::AkismetService).to receive(:new).and_return fake_akismet_service
end
describe '#mark_as_ham!' do
context 'AkismetService returns false (Akismet cannot be reached, etc)' do
before do
allow(fake_akismet_service).to receive(:submit_ham).and_return false
end
it 'returns false' do
expect(subject.mark_as_ham!).to be_falsey
end
it 'does not update the record' do
expect { subject.mark_as_ham! }.not_to change { spam_log.submitted_as_ham }
end
context 'if spam log record has already been marked as spam' do
before do
spam_log.update_attribute(:submitted_as_ham, true)
end
it 'does not update the record' do
expect { subject.mark_as_ham! }.not_to change { spam_log.submitted_as_ham }
end
end
end
context 'Akismet ham submission is successful' do
before do
spam_log.update_attribute(:submitted_as_ham, false)
allow(fake_akismet_service).to receive(:submit_ham).and_return true
end
it 'returns true' do
expect(subject.mark_as_ham!).to be_truthy
end
it 'updates the record' do
expect { subject.mark_as_ham! }.to change { spam_log.submitted_as_ham }.from(false).to(true)
end
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment