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
1dc99b4c
Commit
1dc99b4c
authored
Nov 12, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8251 from cirosantilli/factor-regex-message-spec
Factor regex error messages with spec API tests
parents
ae841371
98db90c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+2
-4
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+2
-4
No files found.
spec/requests/api/projects_spec.rb
View file @
1dc99b4c
...
@@ -203,14 +203,12 @@ describe API::API, api: true do
...
@@ -203,14 +203,12 @@ describe API::API, api: true do
json_response
[
'message'
][
'name'
].
should
==
[
json_response
[
'message'
][
'name'
].
should
==
[
'can\'t be blank'
,
'can\'t be blank'
,
'is too short (minimum is 0 characters)'
,
'is too short (minimum is 0 characters)'
,
'can contain only letters, digits, \'_\', \'-\' and \'.\' and '
\
Gitlab
::
Regex
.
project_regex_message
'space. It must start with letter, digit or \'_\'.'
]
]
json_response
[
'message'
][
'path'
].
should
==
[
json_response
[
'message'
][
'path'
].
should
==
[
'can\'t be blank'
,
'can\'t be blank'
,
'is too short (minimum is 0 characters)'
,
'is too short (minimum is 0 characters)'
,
'can contain only letters, digits, \'_\', \'-\' and \'.\'. '
\
Gitlab
::
Regex
.
send
(
:default_regex_message
)
'Cannot start with \'-\' or end in \'.git\''
]
]
end
end
...
...
spec/requests/api/users_spec.rb
View file @
1dc99b4c
...
@@ -140,8 +140,7 @@ describe API::API, api: true do
...
@@ -140,8 +140,7 @@ describe API::API, api: true do
json_response
[
'message'
][
'projects_limit'
].
json_response
[
'message'
][
'projects_limit'
].
should
==
[
'must be greater than or equal to 0'
]
should
==
[
'must be greater than or equal to 0'
]
json_response
[
'message'
][
'username'
].
json_response
[
'message'
][
'username'
].
should
==
[
'can contain only letters, digits, '
\
should
==
[
Gitlab
::
Regex
.
send
(
:default_regex_message
)]
'\'_\', \'-\' and \'.\'. Cannot start with \'-\' or end in \'.git\''
]
end
end
it
"shouldn't available for non admin users"
do
it
"shouldn't available for non admin users"
do
...
@@ -283,8 +282,7 @@ describe API::API, api: true do
...
@@ -283,8 +282,7 @@ describe API::API, api: true do
json_response
[
'message'
][
'projects_limit'
].
json_response
[
'message'
][
'projects_limit'
].
should
==
[
'must be greater than or equal to 0'
]
should
==
[
'must be greater than or equal to 0'
]
json_response
[
'message'
][
'username'
].
json_response
[
'message'
][
'username'
].
should
==
[
'can contain only letters, digits, '
\
should
==
[
Gitlab
::
Regex
.
send
(
:default_regex_message
)]
'\'_\', \'-\' and \'.\'. Cannot start with \'-\' or end in \'.git\''
]
end
end
context
"with existing user"
do
context
"with existing user"
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