diff --git a/test/unit/template_importer_test.rb b/test/unit/template_importer_test.rb index 5e3245f7..667cd16c 100644 --- a/test/unit/template_importer_test.rb +++ b/test/unit/template_importer_test.rb @@ -186,6 +186,7 @@ def importer(opts = {}) setup_settings imp = ForemanTemplates::TemplateImporter.new imp.class.setting_overrides.each do |attribute| + next if assert_both_equal_nil imp.public_send(attribute), Setting["template_sync_#{attribute}".to_sym] assert_equal imp.public_send(attribute), Setting["template_sync_#{attribute}".to_sym] end end @@ -259,5 +260,15 @@ def setup_settings(opts = {}) FactoryGirl.create(:setting, :settings_type => "boolean", :category => category, :name => 'template_sync_negate', :default => false) FactoryGirl.create(:setting, :settings_type => "string", :category => category, :name => 'template_sync_branch', :default => default_branch) end + + def assert_both_equal_nil(expected, actual) + if expected.nil? || actual.nil? + assert_nil expected + assert_nil actual + true + else + false + end + end end end