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
583ec932
Commit
583ec932
authored
Mar 27, 2020
by
charlieablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tiny refactor of spam tests
parent
3c6ac64e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
spec/services/spam/spam_check_service_spec.rb
spec/services/spam/spam_check_service_spec.rb
+4
-4
No files found.
spec/services/spam/spam_check_service_spec.rb
View file @
583ec932
...
@@ -103,7 +103,7 @@ describe Spam::SpamCheckService do
...
@@ -103,7 +103,7 @@ describe Spam::SpamCheckService do
issue
.
description
=
'SPAM!'
issue
.
description
=
'SPAM!'
end
end
context
'when indicated as spam by
a
kismet'
do
context
'when indicated as spam by
A
kismet'
do
before
do
before
do
allow
(
Spam
::
AkismetService
).
to
receive
(
:new
).
and_return
(
double
(
spam?:
true
))
allow
(
Spam
::
AkismetService
).
to
receive
(
:new
).
and_return
(
double
(
spam?:
true
))
end
end
...
@@ -115,7 +115,7 @@ describe Spam::SpamCheckService do
...
@@ -115,7 +115,7 @@ describe Spam::SpamCheckService do
it_behaves_like
'akismet spam'
it_behaves_like
'akismet spam'
it
'
chec
ks as spam'
do
it
'
mar
ks as spam'
do
subject
subject
expect
(
issue
.
reload
.
spam
).
to
be_truthy
expect
(
issue
.
reload
.
spam
).
to
be_truthy
...
@@ -125,7 +125,7 @@ describe Spam::SpamCheckService do
...
@@ -125,7 +125,7 @@ describe Spam::SpamCheckService do
context
'when allow_possible_spam feature flag is true'
do
context
'when allow_possible_spam feature flag is true'
do
it_behaves_like
'akismet spam'
it_behaves_like
'akismet spam'
it
'does not
chec
k as spam'
do
it
'does not
mar
k as spam'
do
subject
subject
expect
(
issue
.
spam
).
to
be_falsey
expect
(
issue
.
spam
).
to
be_falsey
...
@@ -133,7 +133,7 @@ describe Spam::SpamCheckService do
...
@@ -133,7 +133,7 @@ describe Spam::SpamCheckService do
end
end
end
end
context
'when not indicated as spam by
a
kismet'
do
context
'when not indicated as spam by
A
kismet'
do
before
do
before
do
allow
(
Spam
::
AkismetService
).
to
receive
(
:new
).
and_return
(
double
(
spam?:
false
))
allow
(
Spam
::
AkismetService
).
to
receive
(
:new
).
and_return
(
double
(
spam?:
false
))
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