diff --git a/spec/engine/miq_ae_method_service/miq_ae_service_model_base_spec.rb b/spec/engine/miq_ae_method_service/miq_ae_service_model_base_spec.rb index 100705f9c..d23c19b7b 100644 --- a/spec/engine/miq_ae_method_service/miq_ae_service_model_base_spec.rb +++ b/spec/engine/miq_ae_method_service/miq_ae_service_model_base_spec.rb @@ -104,13 +104,13 @@ end it 'loads object from yaml' do - expect(YAML.safe_load(svc_service.to_yaml)).to eq(svc_service) + expect(YAML.safe_load(svc_service.to_yaml, [MiqAeMethodService::MiqAeServiceService])).to eq(svc_service) end it 'loads invalid svc_model for objects without related ar_model' do yaml = svc_service.to_yaml service.delete - model_from_yaml = YAML.safe_load(yaml) + model_from_yaml = YAML.safe_load(yaml, [MiqAeMethodService::MiqAeServiceService]) expect { model_from_yaml.reload }.to raise_error( NoMethodError, "undefined method `reload' for nil:NilClass" diff --git a/spec/engine/miq_ae_state_machine_retry_spec.rb b/spec/engine/miq_ae_state_machine_retry_spec.rb index 0c320ad83..223c44856 100644 --- a/spec/engine/miq_ae_state_machine_retry_spec.rb +++ b/spec/engine/miq_ae_state_machine_retry_spec.rb @@ -280,6 +280,6 @@ def create_restart_model(script1, script2, script3) expect(MiqQueue.count).to eq(2) q = MiqQueue.where(:state => 'ready').first expect(q[:server_guid]).to be_nil - expect(YAML.safe_load(q.args.first[:ae_state_data])).to eq(ae_state_data) + expect(YAML.load(q.args.first[:ae_state_data])).to eq(ae_state_data) end end