Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab FOSS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab FOSS
Commits
497a28c5
There was a problem fetching the pipeline summary.
Commit
497a28c5
authored
8 years ago
by
Phil Hughes
Browse files
Options
Downloads
Patches
Plain Diff
Fixed project model tests
parent
f2fb574d
No related branches found
No related tags found
1 merge request
!4280
Updated erorr message when project limit is zero
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/project.rb
+2
-2
2 additions, 2 deletions
app/models/project.rb
spec/models/project_spec.rb
+1
-1
1 addition, 1 deletion
spec/models/project_spec.rb
with
3 additions
and
3 deletions
app/models/project.rb
+
2
−
2
View file @
497a28c5
...
...
@@ -434,9 +434,9 @@ def check_limit
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
...
...
This diff is collapsed.
Click to expand it.
spec/models/project_spec.rb
+
1
−
1
View file @
497a28c5
...
...
@@ -60,7 +60,7 @@
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment