diff --git a/app/models/katello/host/subscription_facet.rb b/app/models/katello/host/subscription_facet.rb index 7ee14bd62a8..bbf6fd8a051 100644 --- a/app/models/katello/host/subscription_facet.rb +++ b/app/models/katello/host/subscription_facet.rb @@ -158,7 +158,7 @@ def candlepin_environments { :id => cve.content_view.cp_environment_id(cve.lifecycle_environment) } end else - self.host.organization.default_content_view.cp_environment_id(self.host.organization.library) + [{ :id => self.host.organization.default_content_view.cp_environment_id(self.host.organization.library) }] end end diff --git a/test/models/host/subscription_facet_test.rb b/test/models/host/subscription_facet_test.rb index a169706fba9..d2468a2fefc 100644 --- a/test/models/host/subscription_facet_test.rb +++ b/test/models/host/subscription_facet_test.rb @@ -187,7 +187,7 @@ def test_candlepin_environment_id def test_candlepin_environment_id_no_content subscription_facet.host.content_facet.destroy! - assert_equal subscription_facet.reload.candlepin_environments.first, ContentViewEnvironment.where(:content_view_id => org.default_content_view, + assert_equal subscription_facet.reload.candlepin_environments.first[:id], ContentViewEnvironment.where(:content_view_id => org.default_content_view, :environment_id => org.library).first.cp_id end