throw(:error,error(_(%q(You are not allowed to push into this branch. Create another branch or open a merge request.)),:forbidden))unlesspush_authorized?
execute_steps
end
private
defcheck_push_authorized(result)
returnerror(_('You are not allowed to push into this branch. Create another branch or open a merge request.'),:forbidden)unlesspush_authorized?
success(result)
end
defcheck_branch_name(result)
returnerror(_('There was an error creating the dashboard, branch name is invalid.'),:bad_request)unlessvalid_branch_name?
returnerror(_('There was an error creating the dashboard, branch named: %{branch} already exists.')%{branch: params[:branch]},:bad_request)unlessnew_or_default_branch?
throw(:error,error(_('There was an error creating the dashboard, branch name is invalid.'),:bad_request))unlessvalid_branch_name?
throw(:error,error(_('There was an error creating the dashboard, branch named: %{branch} already exists.')%{branch: params[:branch]},:bad_request))unlessnew_or_default_branch?# temporary validation for first UI iteration
context'user does not have push right to repository'do
it_behaves_like'misconfigured dashboard service response',:forbidden,%q(You are not allowed to push into this branch. Create another branch or open a merge request.)
it_behaves_like'misconfigured dashboard service response with stepable',:forbidden,'You are not allowed to push into this branch. Create another branch or open a merge request.'
it_behaves_like'misconfigured dashboard service response',:bad_request,"There was an error creating the dashboard, branch named: existing_branch already exists."
it_behaves_like'misconfigured dashboard service response with stepable',:bad_request,'There was an error creating the dashboard, branch named: existing_branch already exists.'
# temporary not available function for first iteration
# follow up issue https://gitlab.com/gitlab-org/gitlab/issues/196237 which
it_behaves_like'misconfigured dashboard service response',:bad_request,'There was an error creating the dashboard, branch name is invalid.'
it_behaves_like'misconfigured dashboard service response with stepable',:bad_request,'There was an error creating the dashboard, branch name is invalid.'
it_behaves_like'misconfigured dashboard service response',:bad_request,"A file with 'custom_dashboard.yml' already exists in custom_dashboard branch"
it_behaves_like'misconfigured dashboard service response with stepable',:bad_request,"A file with 'custom_dashboard.yml' already exists in custom_dashboard branch"
end
it'extends dashboard template path to absolute url'do