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
d1ca97e4
Commit
d1ca97e4
authored
Feb 22, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove stray conflict
parent
9456fa87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
53 deletions
+0
-53
spec/requests/api/v3/project_snippets_spec.rb
spec/requests/api/v3/project_snippets_spec.rb
+0
-53
No files found.
spec/requests/api/v3/project_snippets_spec.rb
View file @
d1ca97e4
...
...
@@ -145,59 +145,6 @@ describe API::ProjectSnippets, api: true do
expect
(
response
).
to
have_http_status
(
400
)
end
<<<<<<<
HEAD
=======
context
'when the snippet is spam'
do
def
update_snippet
(
snippet_params
=
{})
put
v3_api
(
"/projects/
#{
snippet
.
project
.
id
}
/snippets/
#{
snippet
.
id
}
"
,
admin
),
snippet_params
end
before
do
allow_any_instance_of
(
AkismetService
).
to
receive
(
:is_spam?
).
and_return
(
true
)
end
context
'when the snippet is private'
do
let
(
:visibility_level
)
{
Snippet
::
PRIVATE
}
it
'creates the snippet'
do
expect
{
update_snippet
(
title:
'Foo'
)
}.
to
change
{
snippet
.
reload
.
title
}.
to
(
'Foo'
)
end
end
context
'when the snippet is public'
do
let
(
:visibility_level
)
{
Snippet
::
PUBLIC
}
it
'rejects the snippet'
do
expect
{
update_snippet
(
title:
'Foo'
)
}.
not_to
change
{
snippet
.
reload
.
title
}
end
it
'creates a spam log'
do
expect
{
update_snippet
(
title:
'Foo'
)
}.
to
change
{
SpamLog
.
count
}.
by
(
1
)
end
end
context
'when the private snippet is made public'
do
let
(
:visibility_level
)
{
Snippet
::
PRIVATE
}
it
'rejects the snippet'
do
expect
{
update_snippet
(
title:
'Foo'
,
visibility_level:
Snippet
::
PUBLIC
)
}.
not_to
change
{
snippet
.
reload
.
title
}
expect
(
response
).
to
have_http_status
(
400
)
expect
(
json_response
[
'message'
]).
to
eq
({
"error"
=>
"Spam detected"
})
end
it
'creates a spam log'
do
expect
{
update_snippet
(
title:
'Foo'
,
visibility_level:
Snippet
::
PUBLIC
)
}.
to
change
{
SpamLog
.
count
}.
by
(
1
)
end
end
end
>>>>>>>
Revert
"Prefer leading style for Style/DotPosition"
end
describe
'DELETE /projects/:project_id/snippets/:id/'
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