Skip to content

Commit

Permalink
wip test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz committed Nov 3, 2023
1 parent 43c1e1b commit 83d3337
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module Katello
# this is Katello's host bulk actions controller, not to be confused with Foreman's
class Api::V2::HostsBulkActionsController < Api::V2::ApiController
include Concerns::Api::V2::BulkHostsExtensions
include Katello::Concerns::Api::V2::ContentOverridesController
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'katello_test_helper'

module Katello
# testing Katello's overrides of Foreman's HostsBulkActionsController
class Api::V2::HostsBulkActionsControllerExtensionsTest < ActionController::TestCase
def setup
@host1 = FactoryBot.create(:host, :with_subscription, :with_content, :organization => @view.organization, :content_view => @view, :lifecycle_environment => @library)
@host2 = FactoryBot.create(:host, :with_subscription, :with_content, :organization => @view.organization, :content_view => @view, :lifecycle_environment => @library)
end

def test_bulk_destroy
Katello::RegistrationManager.expects(:unregister_host).twice
delete :bulk_destroy, params: { :search => "id ^ (#{[@host1.id, @host2.id].join(',')})" }
assert_response :success
end
end
end

0 comments on commit 83d3337

Please sign in to comment.