Read about our upcoming Code of Conduct on this issue

Commit 497a28c5 authored by Phil Hughes's avatar Phil Hughes
Browse files

Fixed project model tests

parent cee1020e226f
...@@ -434,9 +434,9 @@ def check_limit ...@@ -434,9 +434,9 @@ def check_limit
projects_limit = creator.projects_limit projects_limit = creator.projects_limit
if projects_limit == 0 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 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
end end
rescue rescue
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
project2 = build(:project) project2 = build(:project)
allow(project2).to receive(:creator).and_return(double(can_create_project?: false, projects_limit: 0).as_null_object) 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).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
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment