diff options
author | Nick Thomas <nick@gitlab.com> | 2016-09-19 21:28:41 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-09-27 15:17:56 +0300 |
commit | 3ed80a0176a0c8155ff6f84a8f3e70718babd8ce (patch) | |
tree | 44024da6998dfaabd0de193cb510d8ea96f8fe21 /spec/helpers | |
parent | fca610e5cbf5382f3814120227a0ca11440c8a9f (diff) |
Enforce the fork_project permission in Projects::CreateService
Projects::ForkService delegates to this service almost entirely, but needed
one small change so it would propagate create errors correctly.
CreateService#execute needs significant refactoring; it is now right at the
complexity limit set by Rubocop. I avoided doing so in this commit to keep the
diff as small as possible.
Several tests depend on the insecure behaviour of ForkService, so fi them up at
the same time.
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/projects_helper_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index 70032e7df94..bcd53440cb4 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -11,7 +11,7 @@ describe ProjectsHelper do describe "can_change_visibility_level?" do let(:project) { create(:project) } - let(:user) { create(:user) } + let(:user) { create(:project_member, :reporter, user: create(:user), project: project).user } let(:fork_project) { Projects::ForkService.new(project, user).execute } it "returns false if there are no appropriate permissions" do |