Skip to content

Commit

Permalink
Refs #37140 - fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz committed Feb 5, 2024
1 parent 1f12933 commit 1476a39
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 45 deletions.
4 changes: 1 addition & 3 deletions app/controllers/katello/api/v2/organizations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ def update
param :organization, Hash do
param :label, String, :required => false
end
param :simple_content_access, :bool, :desc => N_('Whether to turn on Simple Content Access for the organization.'), :required => false, :default => true, deprecated: true
def create
@organization = Organization.new(resource_params)
sca = params.key?(:simple_content_access) ? ::Foreman::Cast.to_bool(params[:simple_content_access]) : true
creator = ::Katello::OrganizationCreator.new(@organization, sca: sca)
creator = ::Katello::OrganizationCreator.new(@organization)
creator.create!
@organization.reload
# @taxonomy instance variable is necessary for foreman side
Expand Down
16 changes: 0 additions & 16 deletions test/services/katello/organization_creator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,6 @@ def test_create
validate_creator(creator)
end

def test_create_with_sca_off
org = FactoryBot.build(:organization)
creator = Katello::OrganizationCreator.new(org, sca: false)

Katello::Ping.expects(:ping!).returns(true)
org.expects(:candlepin_owner_exists?).returns(false)
Katello::Resources::Candlepin::Owner.expects(:create).with(org.name, org.name, content_access_mode: 'entitlement').returns(true)
Katello::Resources::Candlepin::Owner.expects(:get_ueber_cert).returns(true)
Katello::ContentViewEnvironment.any_instance.expects(:exists_in_candlepin?).returns(false)
Katello::Resources::Candlepin::Environment.expects(:create).returns(true)

creator.create!
validate_org(org)
validate_creator(creator)
end

def test_create_rollback
org = FactoryBot.build(:organization, name: 'rollback_org')
creator = Katello::OrganizationCreator.new(org)
Expand Down
2 changes: 1 addition & 1 deletion webpack/scenes/Subscriptions/SubscriptionsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Immutable from 'seamless-immutable';
import { translate as __ } from 'foremanReact/common/I18n';
import { propsToCamelCase } from 'foremanReact/common/helpers';
import { isEmpty } from 'lodash';
import { Grid, Row, Col, Alert } from 'patternfly-react';
import { Grid, Row, Col } from 'patternfly-react';
import { Popover, Flex, FlexItem } from '@patternfly/react-core';
import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
import ModalProgressBar from 'foremanReact/components/common/ModalProgressBar';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,35 +67,13 @@ exports[`subscriptions page should render 1`] = `
disableManifestActions={true}
disabledReason="This is disabled because no connection could be made to the upstream Manifest."
refresh={[Function]}
simpleContentAccess={false}
taskInProgress={false}
upload={[Function]}
/>
<div
className="modal-container"
id="subscriptions-table"
>
<Alert
className=""
onDismiss={null}
type="warning"
>
<FormattedMessage
defaultMessage="This organization is not using {scaLink}. Entitlement-based subscription management is deprecated and will be removed in Katello 4.12."
id="sca-alert"
values={
Object {
"scaLink": <a
href="https://access.redhat.com/articles/simple-content-access"
rel="noreferrer"
target="_blank"
>
Simple Content Access
</a>,
}
}
/>
</Alert>
<SubscriptionsTable
canManageSubscriptionAllocations={false}
emptyState={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ Object {
"deleteModalOpened": false,
"hasUpstreamConnection": false,
"searchQuery": "some-query",
"simpleContentAccessEligible": false,
"task": Object {},
"taskModalOpened": false,
}
`;

exports[`Subscriptions selectors should select whether we are simple content access eligible 1`] = `false`;

exports[`Subscriptions selectors should select whether we have an upstream connection 1`] = `false`;

0 comments on commit 1476a39

Please sign in to comment.