From 06e4b95179397ce51c979f7464996cee5a0c32c9 Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Thu, 2 Apr 2020 20:40:38 -0400 Subject: [PATCH] Remote namespace#parent_id from specs It is being pedantic, but nicer / quicker this way --- spec/models/miq_ae_class_spec.rb | 6 +++--- spec/models/miq_ae_method_spec.rb | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/models/miq_ae_class_spec.rb b/spec/models/miq_ae_class_spec.rb index c67c31e2944..44f62f3c16e 100644 --- a/spec/models/miq_ae_class_spec.rb +++ b/spec/models/miq_ae_class_spec.rb @@ -178,13 +178,13 @@ def set_priority(name, value) context "#copy" do before do - @d1 = FactoryBot.create(:miq_ae_namespace, :name => "domain1", :parent_id => nil, :priority => 1) - @ns1 = FactoryBot.create(:miq_ae_namespace, :name => "ns1", :parent_id => @d1.id) + @d1 = FactoryBot.create(:miq_ae_namespace, :name => "domain1", :parent => nil, :priority => 1) + @ns1 = FactoryBot.create(:miq_ae_namespace, :name => "ns1", :parent => @d1) @cls1 = FactoryBot.create(:miq_ae_class, :name => "cls1", :namespace_id => @ns1.id) @cls2 = FactoryBot.create(:miq_ae_class, :name => "cls2", :namespace_id => @ns1.id) @d2 = FactoryBot.create(:miq_ae_domain, :name => "domain2", :priority => 2) - @ns2 = FactoryBot.create(:miq_ae_namespace, :name => "ns2", :parent_id => @d2.id) + @ns2 = FactoryBot.create(:miq_ae_namespace, :name => "ns2", :parent => @d2) end it "copies classes under specified namespace" do diff --git a/spec/models/miq_ae_method_spec.rb b/spec/models/miq_ae_method_spec.rb index f0da0491dc2..80af6b19fbb 100644 --- a/spec/models/miq_ae_method_spec.rb +++ b/spec/models/miq_ae_method_spec.rb @@ -40,13 +40,13 @@ context "#copy" do let(:d2) { FactoryBot.create(:miq_ae_domain, :name => "domain2", :priority => 2) } - let(:ns1) { FactoryBot.create(:miq_ae_namespace, :name => "ns1", :parent_id => @d1.id) } + let(:ns1) { FactoryBot.create(:miq_ae_namespace, :name => "ns1", :parent => @d1) } let(:m1) { FactoryBot.create(:miq_ae_method, :class_id => @cls1.id, :name => "foo_method1", :scope => "instance", :language => "ruby", :location => "inline") } let(:m2) { FactoryBot.create(:miq_ae_method, :class_id => @cls1.id, :name => "foo_method2", :scope => "instance", :language => "ruby", :location => "inline") } before do - @d1 = FactoryBot.create(:miq_ae_namespace, :name => "domain1", :parent_id => nil, :priority => 1) + @d1 = FactoryBot.create(:miq_ae_namespace, :name => "domain1", :parent => nil, :priority => 1) @cls1 = FactoryBot.create(:miq_ae_class, :name => "cls1", :namespace_id => ns1.id) - @ns2 = FactoryBot.create(:miq_ae_namespace, :name => "ns2", :parent_id => d2.id) + @ns2 = FactoryBot.create(:miq_ae_namespace, :name => "ns2", :parent => d2) end it "copies instances under specified namespace" do @@ -117,7 +117,7 @@ it "#domain" do d1 = FactoryBot.create(:miq_ae_system_domain, :name => 'dom1', :priority => 10) - n1 = FactoryBot.create(:miq_ae_namespace, :name => 'ns1', :parent_id => d1.id) + n1 = FactoryBot.create(:miq_ae_namespace, :name => 'ns1', :parent => d1) c1 = FactoryBot.create(:miq_ae_class, :namespace_id => n1.id, :name => "foo") m1 = FactoryBot.create(:miq_ae_method, :class_id => c1.id, @@ -130,7 +130,7 @@ it "#to_export_yaml" do d1 = FactoryBot.create(:miq_ae_system_domain, :name => 'dom1', :priority => 10) - n1 = FactoryBot.create(:miq_ae_namespace, :name => 'ns1', :parent_id => d1.id) + n1 = FactoryBot.create(:miq_ae_namespace, :name => 'ns1', :parent => d1) c1 = FactoryBot.create(:miq_ae_class, :namespace_id => n1.id, :name => "foo") m1 = FactoryBot.create(:miq_ae_method, :class_id => c1.id,