-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #6773 - Host inherits Content Source from Hostgroup
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright 2014 Red Hat, Inc. | ||
# | ||
# This software is licensed to you under the GNU General Public | ||
# License as published by the Free Software Foundation; either version | ||
# 2 of the License (GPLv2) or (at your option) any later version. | ||
# There is NO WARRANTY for this software, express or implied, | ||
# including the implied warranties of MERCHANTABILITY, | ||
# NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should | ||
# have received a copy of GPLv2 along with this software; if not, see | ||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | ||
|
||
require 'katello_test_helper' | ||
|
||
module Katello | ||
class HostgroupExtensionsTest < ActiveSupport::TestCase | ||
def inherited_content_source_id_with_ancestry | ||
root = Hostgroup.new(:name => 'AHostgroup', :content_source => smart_proxies(:puppetmaster)) | ||
root.save | ||
|
||
child = Hostgroup.new(:name => 'AChild', :parent => root) | ||
child.save | ||
|
||
assert_equal smart_proxies(:puppetmaster).id, child.inherited_content_source_id | ||
end | ||
|
||
def inherited_content_source_id_without_ancestry | ||
root = Hostgroup.new(:name => 'AHostgroup', :content_source => smart_proxies(:puppetmaster)) | ||
root.save | ||
|
||
assert_equal smart_proxies(:puppetmaster).id, root.inherited_content_source_id | ||
end | ||
end | ||
end |