Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #33036 - Make via Katello-agent option clickable on content host errata page #9479

Merged
merged 1 commit into from Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/katello/api/v2/host_errata_controller.rb
Expand Up @@ -115,7 +115,7 @@ def find_errata_ids
fail HttpErrors::NotFound, _("Couldn't find errata ids '%s'") % missing.to_sentence if missing.any?
@errata_ids = params[:errata_ids]
else
@errata_ids = find_bulk_errata_ids([@host], params[:bulk_errata_ids].to_json)
@errata_ids = find_bulk_errata_ids([@host], params[:bulk_errata_ids])
end
end
end
Expand Down
Expand Up @@ -126,7 +126,7 @@ angular.module('Bastion.content-hosts').controller('ContentHostErrataController'

$scope.performViaKatelloAgent = function () {
var errataIds = $scope.selectedErrataIds();
HostErratum.apply({id: $scope.host.id, 'bulk_errata_ids': errataIds},
HostErratum.apply({id: $scope.host.id, 'bulk_errata_ids': angular.toJson(errataIds)},
function (task) {
$scope.table.selectAll(false);
$scope.transitionTo('content-host.tasks.details', {taskId: task.id});
Expand Down
Expand Up @@ -99,12 +99,13 @@ describe('Controller: ContentHostErrataController', function() {
});

it("provide a way to apply errata", function() {
var bulk_errata_ids = angular.toJson({included: { ids: [mockErratum.errata_id], params: {} }});

spyOn(HostErratum, "apply").and.callThrough();
spyOn($scope.table, "selectAll");
spyOn($scope, "transitionTo");
$scope.applySelected();
expect(HostErratum.apply).toHaveBeenCalledWith({id: host.id, bulk_errata_ids: {included: { ids: [mockErratum.errata_id], params: {} }}},
jasmine.any(Function));
expect(HostErratum.apply).toHaveBeenCalledWith({id: host.id, bulk_errata_ids: bulk_errata_ids}, jasmine.any(Function));
expect($scope.transitionTo).toHaveBeenCalledWith('content-host.tasks.details', {taskId: mockTask.id});
expect($scope.table.selectAll).toHaveBeenCalledWith(false);
});
Expand Down