Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
9f39310d81b9
Commit
9f39310d
authored
May 25, 2016
by
Phil Hughes
Browse files
Fixed project model tests
parent
cee1020e226f
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
9f39310d
...
...
@@ -434,5 +434,5 @@
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
...
...
@@ -438,5 +438,5 @@
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 @
9f39310d
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
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