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
Léo-Paul Géneau
gitlab-ce
Commits
497a28c5
Commit
497a28c5
authored
May 25, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed project model tests
parent
f2fb574d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/models/project.rb
app/models/project.rb
+2
-2
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
No files found.
app/models/project.rb
View file @
497a28c5
...
...
@@ -434,9 +434,9 @@ class Project < ActiveRecord::Base
projects_limit
=
creator
.
projects_limit
if
projects_limit
==
0
self
.
errors
.
add
(
:
base
,
"Personal project creation is not allowed. Please contact your administrator with questions"
)
self
.
errors
.
add
(
:
limit_reached
,
"Personal project creation is not allowed. Please contact your administrator with questions"
)
else
self
.
errors
.
add
(
:
base
,
"Your project limit is
#{
projects_limit
}
projects! Please contact your administrator to increase it"
)
self
.
errors
.
add
(
:
limit_reached
,
"Your project limit is
#{
projects_limit
}
projects! Please contact your administrator to increase it"
)
end
end
rescue
...
...
spec/models/project_spec.rb
View file @
497a28c5
...
...
@@ -60,7 +60,7 @@ describe Project, models: true do
project2
=
build
(
:project
)
allow
(
project2
).
to
receive
(
:creator
).
and_return
(
double
(
can_create_project?:
false
,
projects_limit:
0
).
as_null_object
)
expect
(
project2
).
not_to
be_valid
expect
(
project2
.
errors
[
:limit_reached
].
first
).
to
match
(
/
Your project limit is 0
/
)
expect
(
project2
.
errors
[
:limit_reached
].
first
).
to
match
(
/
Personal project creation is not allowed
/
)
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