From e7b82f406402c3ee03bd69fe67b3dfa9584347b1 Mon Sep 17 00:00:00 2001 From: Milan Zazrivec Date: Wed, 8 Aug 2018 17:13:38 +0200 Subject: [PATCH 1/2] Correctly render name of orchestration template Rather than the name of its orchestration stack. https://bugzilla.redhat.com/show_bug.cgi?id=1601523 --- app/controllers/orchestration_stack_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/orchestration_stack_controller.rb b/app/controllers/orchestration_stack_controller.rb index 8525f280449..ad5cd9a7fc4 100644 --- a/app/controllers/orchestration_stack_controller.rb +++ b/app/controllers/orchestration_stack_controller.rb @@ -20,7 +20,7 @@ def self.display_methods end def display_stack_orchestration_template - drop_breadcrumb(:name => "%{name} (Orchestration Template)" % {:name => @record.name}, + drop_breadcrumb(:name => "%{name} (Orchestration Template)" % {:name => @record.orchestration_template.name}, :url => show_link(@record, :display => @display)) end From 37ecf74cf987710eea3fd6c5ab5ac295fecb3dd8 Mon Sep 17 00:00:00 2001 From: Milan Zazrivec Date: Wed, 8 Aug 2018 17:14:11 +0200 Subject: [PATCH 2/2] Spec for correctly rendering OT name https://bugzilla.redhat.com/show_bug.cgi?id=1601523 --- spec/controllers/orchestration_stack_controller_spec.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/controllers/orchestration_stack_controller_spec.rb b/spec/controllers/orchestration_stack_controller_spec.rb index a2f5b3d5820..95cf9e0db3e 100644 --- a/spec/controllers/orchestration_stack_controller_spec.rb +++ b/spec/controllers/orchestration_stack_controller_spec.rb @@ -49,7 +49,8 @@ end context "orchestration templates" do - let(:record) { FactoryGirl.create(:orchestration_stack_cloud_with_template) } + let(:ems) { FactoryGirl.create(:ems_cloud) } + let(:record) { FactoryGirl.create(:orchestration_stack_cloud_with_template, :ext_management_system => ems, :name => 'stack01') } before do session[:settings] = { @@ -67,6 +68,12 @@ expect(response.status).to eq(200) expect(response).to render_template(:partial => "orchestration_stack/_stack_orchestration_template") end + + it "renders template name correctly" do + expect(response.status).to eq(200) + expect(response.body).to include("

\ntemplate name") + expect(response.body).not_to include("

\nstack01") + end end end