Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote namespace#parent_id from specs #20046

Merged
merged 1 commit into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec/models/miq_ae_class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions spec/models/miq_ae_method_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down