Sha256: db9c7891394301ea9a00166b68a3003e1eb129d3deb9af87e147f44a4386da1a

Contents?: true

Size: 1.1 KB

Versions: 62

Compression:

Stored size: 1.1 KB

Contents

require_relative '../test_helper'
require 'hammer_cli_katello/package_group'

module HammerCLIKatello
  describe PackageGroupCommand::ListCommand do
    it 'allows minimal options' do
      api_expects(:package_groups, :index)

      run_cmd(%w(package-group list))
    end

    it 'can be provided by repository ID' do
      api_expects(:package_groups, :index) do |params|
        params['repository_id'] == 1
      end

      run_cmd(%w(package-group list --repository-id 1))
    end

    it 'needs product options with repository name' do
      cmd = run_cmd(%w(package-group list --repository Repo))
      api_expects_no_call
      error_msg = "At least one of options --product, --product-id is required."
      assert_match error_msg, cmd.err
    end

    it 'can be provided product id and repository name' do
      api_expects(:repositories, :index)
        .with_params(name: "Repo", product_id: 1)
        .returns(index_response([{'id' => 1}]))

      api_expects(:package_groups, :index)
        .with_params(repository_id: 1)

      run_cmd(%w(package-group list --repository Repo --product-id 1))
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
hammer_cli_katello-1.16.1 test/functional/package_group/list_test.rb
hammer_cli_katello-1.15.0 test/functional/package_group/list_test.rb
hammer_cli_katello-1.14.3 test/functional/package_group/list_test.rb
hammer_cli_katello-1.14.2 test/functional/package_group/list_test.rb
hammer_cli_katello-1.14.0 test/functional/package_group/list_test.rb
hammer_cli_katello-1.14.1 test/functional/package_group/list_test.rb
hammer_cli_katello-1.12.0 test/functional/package_group/list_test.rb
hammer_cli_katello-1.11.2 test/functional/package_group/list_test.rb
hammer_cli_katello-1.11.1 test/functional/package_group/list_test.rb
hammer_cli_katello-1.11.0 test/functional/package_group/list_test.rb
hammer_cli_katello-1.10.1 test/functional/package_group/list_test.rb
hammer_cli_katello-1.10.0 test/functional/package_group/list_test.rb
hammer_cli_katello-1.8.3 test/functional/package_group/list_test.rb
hammer_cli_katello-1.8.2 test/functional/package_group/list_test.rb
hammer_cli_katello-1.9.1 test/functional/package_group/list_test.rb
hammer_cli_katello-1.9.0 test/functional/package_group/list_test.rb
hammer_cli_katello-1.8.1 test/functional/package_group/list_test.rb
hammer_cli_katello-1.7.3 test/functional/package_group/list_test.rb
hammer_cli_katello-1.8.0 test/functional/package_group/list_test.rb
hammer_cli_katello-1.7.2 test/functional/package_group/list_test.rb