Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e4fe22a1
Commit
e4fe22a1
authored
May 20, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
May 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix leaky constant in spam constants
parent
9eb2d34f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
.rubocop.yml
.rubocop.yml
+0
-1
changelogs/unreleased/leaky-constant-fix-5.yml
changelogs/unreleased/leaky-constant-fix-5.yml
+5
-0
spec/features/issues/spam_issues_spec.rb
spec/features/issues/spam_issues_spec.rb
+2
-0
spec/support/shared_contexts/spam_constants.rb
spec/support/shared_contexts/spam_constants.rb
+5
-3
No files found.
.rubocop.yml
View file @
e4fe22a1
...
...
@@ -378,7 +378,6 @@ RSpec/LeakyConstantDeclaration:
-
'
spec/serializers/commit_entity_spec.rb'
-
'
spec/services/clusters/applications/check_installation_progress_service_spec.rb'
-
'
spec/services/clusters/applications/check_uninstall_progress_service_spec.rb'
-
'
spec/support/shared_contexts/spam_constants.rb'
-
'
spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb'
-
'
spec/support_specs/matchers/exceed_query_limit_helpers_spec.rb'
...
...
changelogs/unreleased/leaky-constant-fix-5.yml
0 → 100644
View file @
e4fe22a1
---
title
:
Remove usage of spam constants in spec
merge_request
:
31959
author
:
Rajendra Kadam
type
:
fixed
spec/features/issues/spam_issues_spec.rb
View file @
e4fe22a1
...
...
@@ -164,6 +164,8 @@ describe 'New issue', :js do
end
context
'when the SpamVerdictService allows'
do
include_context
'includes Spam constants'
before
do
allow_next_instance_of
(
Spam
::
SpamVerdictService
)
do
|
verdict_service
|
allow
(
verdict_service
).
to
receive
(
:execute
).
and_return
(
ALLOW
)
...
...
spec/support/shared_contexts/spam_constants.rb
View file @
e4fe22a1
# frozen_string_literal: true
shared_context
'includes Spam constants'
do
REQUIRE_RECAPTCHA
=
Spam
::
SpamConstants
::
REQUIRE_RECAPTCHA
DISALLOW
=
Spam
::
SpamConstants
::
DISALLOW
ALLOW
=
Spam
::
SpamConstants
::
ALLOW
before
do
stub_const
(
'REQUIRE_RECAPTCHA'
,
Spam
::
SpamConstants
::
REQUIRE_RECAPTCHA
)
stub_const
(
'DISALLOW'
,
Spam
::
SpamConstants
::
DISALLOW
)
stub_const
(
'ALLOW'
,
Spam
::
SpamConstants
::
ALLOW
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment