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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
eb51a4ac
Commit
eb51a4ac
authored
9 years ago
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor previous test and add validation to project model
parent
7ca67796
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+2
-2
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+3
-6
No files found.
lib/gitlab/regex.rb
View file @
eb51a4ac
...
...
@@ -34,12 +34,12 @@ module Gitlab
def
project_path_regex
@project_path_regex
||=
/\A[a-zA-Z0-9_.][a-zA-Z0-9_\-\.]*(?<!\.git)\z/
.
freeze
@project_path_regex
||=
/\A[a-zA-Z0-9_.][a-zA-Z0-9_\-\.]*(?<!\.git
|\.atom
)\z/
.
freeze
end
def
project_path_regex_message
"can contain only letters, digits, '_', '-' and '.'. "
\
"Cannot start with '-'
or end in '.git
'"
\
"Cannot start with '-'
, end in '.git' or end in '.atom
'"
\
end
...
...
This diff is collapsed.
Click to expand it.
spec/controllers/projects_controller_spec.rb
View file @
eb51a4ac
...
...
@@ -88,13 +88,10 @@ describe ProjectsController do
end
context
"when the url contains .atom"
do
let
(
:public_project_with_dot
)
{
create
(
:project
,
:public
,
name:
'my.atom'
,
path:
'my.atom'
)
}
let
(
:public_project_with_dot
_atom
)
{
create
(
:project
,
:public
,
name:
'my.atom'
,
path:
'my.atom'
)
}
it
'loads a project'
do
get
:show
,
namespace_id:
public_project_with_dot
.
namespace
.
path
,
id:
public_project_with_dot
.
path
expect
(
assigns
(
:project
)).
to
eq
(
public_project_with_dot
)
expect
(
response
.
status
).
to
eq
(
200
)
it
'expect an error creating the project'
do
expect
{
public_project_with_dot_atom
}.
to
raise_error
(
ActiveRecord
::
RecordInvalid
)
end
end
end
...
...
This diff is collapsed.
Click to expand it.
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