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

fix service.indirect_vms indirect_service_children #8964

Merged
merged 1 commit into from May 25, 2016
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/service.rb
Expand Up @@ -81,7 +81,7 @@ def request_type
virtual_has_many :services

def indirect_service_children
descendants(:from_depth => 2)
descendants.where.not(child_conditions)
end
Vmdb::Deprecation.deprecate_methods(self, :indirect_service_children)

Expand Down
9 changes: 9 additions & 0 deletions spec/models/service_spec.rb
Expand Up @@ -248,6 +248,15 @@
end
end

describe "#indirect_service_children" do
it "returns 1 level down children" do
create_deep_tree
Vmdb::Deprecation.silenced do
expect(@service.indirect_service_children).to match_array([@service_c11, @service_c12, @service_c121])
end
end
end

describe "#descendants" do
it "returns all descendants" do
create_deep_tree
Expand Down