Sha256: bee301367d451bf74275cc7259ca1e12d03efc2e5a39635a99cdb84af7047b01
Contents?: true
Size: 1.02 KB
Versions: 47
Compression:
Stored size: 1.02 KB
Contents
require 'test_puppet_helper' module ForemanPuppet class PuppetclassesHelperTest < ActionView::TestCase include PuppetclassesHelper describe '.overridden?' do setup do @env = FactoryBot.create(:environment) end it 'returns true when all params are overridden' do pc = FactoryBot.create(:puppetclass, :with_parameters, environments: [@env]) pc.class_params.first.update(override: true) assert pc.class_params.first.override assert overridden?(pc) end it "returns false when one parameter isn't overridden" do pc = FactoryBot.create(:puppetclass, :with_parameters, parameter_count: 2, environments: [@env]) pc.class_params.first.update(override: true) assert pc.class_params.first.override assert_not pc.class_params.last.override assert_not overridden?(pc) end it 'returns false when no parameters' do pc = FactoryBot.create(:puppetclass) assert_not overridden?(pc) end end end end
Version data entries
47 entries across 47 versions & 1 rubygems