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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
e92b563a
Commit
e92b563a
authored
Nov 23, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix model tests
parent
9304d049
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
spec/factories.rb
spec/factories.rb
+7
-4
spec/models/group_spec.rb
spec/models/group_spec.rb
+2
-2
spec/models/namespace_spec.rb
spec/models/namespace_spec.rb
+2
-2
spec/models/project_spec.rb
spec/models/project_spec.rb
+2
-5
No files found.
spec/factories.rb
View file @
e92b563a
...
...
@@ -29,14 +29,17 @@ FactoryGirl.define do
owner
end
factory
:
namespace
do
factory
:
group
do
sequence
(
:name
)
{
|
n
|
"group
#{
n
}
"
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
owner
type
'Group'
end
factory
:group
do
type
'Group'
end
factory
:namespace
do
sequence
(
:name
)
{
|
n
|
"group
#{
n
}
"
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
owner
end
factory
:users_project
do
...
...
spec/models/group_spec.rb
View file @
e92b563a
...
...
@@ -18,7 +18,7 @@ describe Group do
it
{
should
have_many
:projects
}
it
{
should
validate_presence_of
:name
}
it
{
should
validate_uniqueness_of
(
:name
)
}
it
{
should
validate_presence_of
:
code
}
it
{
should
validate_uniqueness_of
(
:
code
)
}
it
{
should
validate_presence_of
:
path
}
it
{
should
validate_uniqueness_of
(
:
path
)
}
it
{
should
validate_presence_of
:owner
}
end
spec/models/namespace_spec.rb
View file @
e92b563a
...
...
@@ -6,7 +6,7 @@ describe Namespace do
it
{
should
have_many
:projects
}
it
{
should
validate_presence_of
:name
}
it
{
should
validate_uniqueness_of
(
:name
)
}
it
{
should
validate_presence_of
:
code
}
it
{
should
validate_uniqueness_of
(
:
code
)
}
it
{
should
validate_presence_of
:
path
}
it
{
should
validate_uniqueness_of
(
:
path
)
}
it
{
should
validate_presence_of
:owner
}
end
spec/models/project_spec.rb
View file @
e92b563a
...
...
@@ -59,9 +59,6 @@ describe Project do
it
{
should
ensure_length_of
(
:description
).
is_within
(
0
..
2000
)
}
it
{
should
validate_presence_of
(
:code
)
}
it
{
should
validate_uniqueness_of
(
:code
)
}
it
{
should
ensure_length_of
(
:code
).
is_within
(
1
..
255
)
}
# TODO: Formats
it
{
should
validate_presence_of
(
:owner
)
}
...
...
@@ -152,7 +149,7 @@ describe Project do
end
it
"returns the full web URL for this repo"
do
project
=
Project
.
new
(
code
:
"somewhere"
)
project
=
Project
.
new
(
path
:
"somewhere"
)
project
.
web_url
.
should
==
"
#{
Gitlab
.
config
.
url
}
/somewhere"
end
...
...
@@ -163,7 +160,7 @@ describe Project do
end
it
"should be invalid repo"
do
project
=
Project
.
new
(
name:
"ok_name"
,
path:
"/INVALID_PATH/"
,
code
:
"NEOK"
)
project
=
Project
.
new
(
name:
"ok_name"
,
path:
"/INVALID_PATH/"
,
path
:
"NEOK"
)
project
.
valid_repo?
.
should
be_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