summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-05-25 08:52:13 +0100
committerPhil Hughes <me@iamphill.com>2016-05-25 09:44:33 +0100
commit497a28c59f042fcce36d1d0682cf225c9743369f (patch)
tree1c3f07f281d00f9c2b64a790599743cc6055a0f9
parentf2fb574d0421eb3b24b640766fa2265fafe20130 (diff)
downloadgitlab-ce-zero-project-creation-error-message.tar.gz
Fixed project model testszero-project-creation-error-message
-rw-r--r--app/models/project.rb4
-rw-r--r--spec/models/project_spec.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 2876150cd6e..f3a56b86d5a 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -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
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 60e1ec43f2b..34dcbf133d6 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -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