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
96c32431
Commit
96c32431
authored
Sep 29, 2020
by
Jake Lear
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update spec language for spam checks to be a bit more accurate
parent
68c4f3db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
12 deletions
+2
-12
ee/spec/models/issue_spec.rb
ee/spec/models/issue_spec.rb
+2
-12
No files found.
ee/spec/models/issue_spec.rb
View file @
96c32431
...
...
@@ -350,7 +350,6 @@ RSpec.describe Issue do
using
RSpec
::
Parameterized
::
TableSyntax
let_it_be
(
:reusable_project
)
{
create
(
:project
)
}
let_it_be
(
:author
)
{
::
User
.
support_bot
}
let
(
:planning
)
{
create
(
:project_label
,
project:
reusable_project
,
name:
'Planning'
)
}
where
(
:visibility_level
,
:confidential
,
:new_attributes
,
:check_for_spam?
)
do
Gitlab
::
VisibilityLevel
::
PUBLIC
|
false
|
{
description:
'woo'
}
|
true
...
...
@@ -361,11 +360,12 @@ RSpec.describe Issue do
Gitlab
::
VisibilityLevel
::
INTERNAL
|
false
|
{
description:
'woo'
}
|
true
Gitlab
::
VisibilityLevel
::
PRIVATE
|
true
|
{
description:
'woo'
}
|
true
Gitlab
::
VisibilityLevel
::
PUBLIC
|
false
|
{
description:
'original description'
}
|
false
Gitlab
::
VisibilityLevel
::
PRIVATE
|
true
|
{
weight:
3
}
|
false
end
with_them
do
context
'when author is a bot'
do
it
'
checks for spam on all issues
'
do
it
'
only checks for spam when description, title, or confidential status is updated
'
do
project
=
reusable_project
project
.
update
(
visibility_level:
visibility_level
)
issue
=
create
(
:issue
,
project:
project
,
confidential:
confidential
,
description:
'original description'
,
author:
author
)
...
...
@@ -376,16 +376,6 @@ RSpec.describe Issue do
end
end
end
it
'does not check for spam when only weight is updated'
do
project
=
reusable_project
project
.
update
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
issue
=
create
(
:issue
,
project:
project
,
weight:
3
,
author:
author
)
issue
.
assign_attributes
({
weight:
2
})
expect
(
issue
.
check_for_spam?
).
to
eq
(
false
)
end
end
describe
'#weight'
do
...
...
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