Revision 6b4b489f
Added by Ori Rabin over 8 years ago
test/unit/host_test.rb | ||
---|---|---|
|
||
test "should be able to delete existing lookup value on update_attributes" do
|
||
host = FactoryGirl.create(:host)
|
||
lookup_key = FactoryGirl.create(:lookup_key, :is_param)
|
||
lookup_key = FactoryGirl.create(:puppetclass_lookup_key)
|
||
lookup_value = FactoryGirl.create(:lookup_value, :lookup_key_id => lookup_key.id,
|
||
:match => "fqdn=#{host.fqdn}", :value => '8080')
|
||
host.reload
|
||
... | ... | |
|
||
test "should be able to update lookup value on update_attributes" do
|
||
host = FactoryGirl.create(:host)
|
||
lookup_key = FactoryGirl.create(:lookup_key, :is_param)
|
||
lookup_key = FactoryGirl.create(:puppetclass_lookup_key)
|
||
lookup_value = FactoryGirl.create(:lookup_value, :lookup_key_id => lookup_key.id,
|
||
:match => "fqdn=#{host.fqdn}", :value => '8080')
|
||
host.reload
|
||
... | ... | |
|
||
test 'changing name with a fqdn should rename lookup_value matcher' do
|
||
host = FactoryGirl.create(:host)
|
||
lookup_key = FactoryGirl.create(:lookup_key, :is_param)
|
||
lookup_key = FactoryGirl.create(:puppetclass_lookup_key)
|
||
lookup_value = FactoryGirl.create(:lookup_value, :lookup_key_id => lookup_key.id,
|
||
:match => "fqdn=#{host.fqdn}", :value => '8080')
|
||
host.reload
|
||
... | ... | |
|
||
test 'changing only name should rename lookup_value matcher' do
|
||
host = FactoryGirl.create(:host, :domain => FactoryGirl.create(:domain))
|
||
lookup_key = FactoryGirl.create(:lookup_key, :is_param)
|
||
lookup_key = FactoryGirl.create(:puppetclass_lookup_key)
|
||
lookup_value = FactoryGirl.create(:lookup_value, :lookup_key_id => lookup_key.id,
|
||
:match => "fqdn=#{host.fqdn}", :value => '8080')
|
||
host.reload
|
||
... | ... | |
|
||
test 'changing host domain should rename lookup_value matcher' do
|
||
host = FactoryGirl.create(:host)
|
||
lookup_key = FactoryGirl.create(:lookup_key, :is_param)
|
||
lookup_key = FactoryGirl.create(:puppetclass_lookup_key)
|
||
lookup_value = FactoryGirl.create(:lookup_value, :lookup_key_id => lookup_key.id,
|
||
:match => "fqdn=#{host.fqdn}", :value => '8080')
|
||
host.reload
|
||
... | ... | |
|
||
test "destroying host should destroy lookup values" do
|
||
host = FactoryGirl.create(:host)
|
||
lookup_key = FactoryGirl.create(:lookup_key, :is_param)
|
||
lookup_key = FactoryGirl.create(:puppetclass_lookup_key)
|
||
lookup_value = FactoryGirl.create(:lookup_value, :lookup_key_id => lookup_key.id,
|
||
:match => "fqdn=#{host.fqdn}", :value => '8080')
|
||
host.reload
|
Also available in: Unified diff
fixes #10832 - separating lookup keys into puppet and variable