Skip to content

Commit

Permalink
Refs #37395: Controller tests
Browse files Browse the repository at this point in the history
  • Loading branch information
parthaa committed May 2, 2024
1 parent ddc84c4 commit f5abb42
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/controllers/hosts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,7 @@ def submit_rebuild_config
if message.blank?
respond_to do |format|
format.html do
process_success :success_msg => _('Configuration successfully rebuilt')
redirect_to(helpers.current_hosts_path)
process_success(:success_redirect => helpers.current_hosts_path, :success_msg => _('Configuration successfully rebuilt'))
end
format.json do
render :json => { :success_msg => _('Configuration successfully rebuilt') }
Expand All @@ -526,8 +525,7 @@ def submit_rebuild_config
else
respond_to do |format|
format.html do
process_response(false, {:message => message})
redirect_to(helpers.current_hosts_path)
process_error(:redirect => helpers.current_hosts_path, :error_msg => message)
end
format.json do
render :json => { :error_msg => message }
Expand Down Expand Up @@ -566,8 +564,7 @@ def submit_multiple_build

respond_to do |format|
format.html do
process_success :success_msg => message
redirect_to(helpers.current_hosts_path)
process_success(:success_redirect => helpers.current_hosts_path, :success_msg => message)
end
format.json do
render :json => { :success_msg => message }
Expand All @@ -577,8 +574,7 @@ def submit_multiple_build
message = _("The following hosts failed the build operation: %s") % missed_hosts.map(&:name).to_sentence
respond_to do |format|
format.html do
process_response(false, {:message => message})
redirect_to(helpers.current_hosts_path)
process_error(:redirect => helpers.current_hosts_path, :error_msg => message)
end
format.json do
render :json => { :error_msg => message }
Expand Down

0 comments on commit f5abb42

Please sign in to comment.