Skip to content

Commit

Permalink
Merge pull request #6620 from vpereira/meta_controller_spec
Browse files Browse the repository at this point in the history
Refactor Meta controller related specs
  • Loading branch information
vpereira committed Dec 19, 2018
2 parents 5bd21f9 + 4a574ed commit be68942
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 463 deletions.
3 changes: 1 addition & 2 deletions src/api/app/controllers/webui/projects/meta_controller.rb
Expand Up @@ -12,8 +12,7 @@ def show

def update
authorize @project, :update?
updater = ::MetaControllerService::ProjectUpdater.new(project: @project, request_data: @request_data)
updater.call
updater = ::MetaControllerService::ProjectUpdater.new(project: @project, request_data: @request_data).call

status = if updater.valid?
flash.now[:success] = 'Config successfully saved!'
Expand Down
Expand Up @@ -10,13 +10,14 @@ def call
@validator.call
unless @validator.valid?
@errors = @validator.errors
return
return self
end

Project.transaction do
@errors = @project.update_from_xml(@request_data)[:error]
@project.store if valid?
end
self
end

def errors
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit be68942

Please sign in to comment.