diff --git a/app/models/manageiq/providers/ansible_tower/provider.rb b/app/models/manageiq/providers/ansible_tower/provider.rb index b59f9e99..9e4448aa 100644 --- a/app/models/manageiq/providers/ansible_tower/provider.rb +++ b/app/models/manageiq/providers/ansible_tower/provider.rb @@ -4,6 +4,5 @@ class ManageIQ::Providers::AnsibleTower::Provider < ::Provider has_one :automation_manager, :foreign_key => "provider_id", :class_name => "ManageIQ::Providers::AnsibleTower::AutomationManager", - :dependent => :destroy, :autosave => true end diff --git a/spec/support/ansible_shared/provider.rb b/spec/support/ansible_shared/provider.rb index 08dc7e69..ac3f40f8 100644 --- a/spec/support/ansible_shared/provider.rb +++ b/spec/support/ansible_shared/provider.rb @@ -22,10 +22,12 @@ describe "#destroy" do it "will remove all child objects" do subject.automation_manager.configured_systems = [ - FactoryGirl.create(:configured_system, :computer_system => - FactoryGirl.create(:computer_system, + FactoryGirl.create(:configured_system_automation_manager, + :computer_system => FactoryGirl.create( + :computer_system, :operating_system => FactoryGirl.create(:operating_system), - :hardware => FactoryGirl.create(:hardware))) + :hardware => FactoryGirl.create(:hardware) + )) ] subject.destroy