diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-02-02 22:35:15 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-02-06 23:51:19 +0300 |
commit | f3aaf906d488ee67ecd84f52febd0ce060fb7683 (patch) | |
tree | ea4ab82dcaaa25c2483a88cbe9d2d7b93dba469a /app/controllers/projects/variables_controller.rb | |
parent | d9d417d405c42721b300e3b4a0dc6656529c3411 (diff) |
Added tests for the variables controller #update action
Diffstat (limited to 'app/controllers/projects/variables_controller.rb')
-rw-r--r-- | app/controllers/projects/variables_controller.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb index 06429f56116..d07ef7889ca 100644 --- a/app/controllers/projects/variables_controller.rb +++ b/app/controllers/projects/variables_controller.rb @@ -15,10 +15,11 @@ class Projects::VariablesController < Projects::ApplicationController @variable = @project.variables.find(params[:id]) if @variable.update_attributes(project_params) - redirect_to namespace_project_settings_ci_cd_path(project.namespace, project), notice: 'Variable was successfully updated.' + flash[:notice] = 'Variables were successfully updated.' else - render action: "show" + flash[:alert] = @variable.errors.full_messages.join(',').html_safe end + redirect_to namespace_project_settings_ci_cd_path(project.namespace, project) end def create |