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
53579e0a
Commit
53579e0a
authored
Feb 25, 2020
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update specs json_message assertion
parent
c16b9a01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
spec/requests/api/groups_spec.rb
spec/requests/api/groups_spec.rb
+5
-7
No files found.
spec/requests/api/groups_spec.rb
View file @
53579e0a
...
@@ -592,23 +592,21 @@ describe API::Groups do
...
@@ -592,23 +592,21 @@ describe API::Groups do
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
response
.
message
).
to
eq
(
'Bad Request'
)
expect
(
response
.
message
).
to
eq
(
'Bad Request'
)
expect
(
json_response
[
'message'
]).
to
eq
(
'Failed to save group'
\
expect
(
json_response
[
'message'
][
'avatar'
]).
to
eq
([
'file format is not supported.'
\
' {:avatar=>["file format is not supported.'
\
' Please try one of the following supported formats:'
\
' Please try one of the following supported formats:'
\
'
png, jpg, jpeg, gif, bmp, tiff, ico"]}'
)
'
png, jpg, jpeg, gif, bmp, tiff, ico'
]
)
end
end
it
'returns 400 if file size exceeds allowed limit for group avatar'
do
it
'returns 400 if file size exceeds allowed limit for group avatar'
do
group_param
=
{
group_param
=
{
avatar:
fixture_file_upload
(
'spec/fixtures/
doc_sample.txt'
,
'text/plain
'
)
avatar:
fixture_file_upload
(
'spec/fixtures/
big-image.png'
,
'image/png
'
)
}
}
put
api
(
"/groups/
#{
group1
.
id
}
"
,
user1
),
params:
group_param
put
api
(
"/groups/
#{
group1
.
id
}
"
,
user1
),
params:
group_param
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
response
.
message
).
to
eq
(
'Bad Request'
)
expect
(
response
.
message
).
to
eq
(
'Bad Request'
)
expect
(
json_response
[
'message'
]).
to
eq
(
'Failed to save group'
\
expect
(
json_response
[
'message'
][
'avatar'
]).
to
eq
([
'is too big (should be at most 200 KB)'
])
' {:avatar=>["is too big (should be at most 200 KB)"]}'
)
end
end
it
'returns 404 for a non existing group'
do
it
'returns 404 for a non existing group'
do
...
@@ -1052,7 +1050,7 @@ describe API::Groups do
...
@@ -1052,7 +1050,7 @@ describe API::Groups do
expect
(
json_response
[
'message'
]).
to
eq
(
'Failed to save group'
\
expect
(
json_response
[
'message'
]).
to
eq
(
'Failed to save group'
\
' {:avatar=>["file format is not supported.'
\
' {:avatar=>["file format is not supported.'
\
' Please try one of the following supported formats:'
\
' Please try one of the following supported formats:'
\
'png, jpg, jpeg, gif, bmp, tiff, ico"]}'
)
'
png, jpg, jpeg, gif, bmp, tiff, ico"]}'
)
end
end
it
'returns 400 if group avatar file size exceeds allowed limit'
do
it
'returns 400 if group avatar file size exceeds allowed limit'
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