Skip to content

Commit

Permalink
Merge pull request ManageIQ#4439 from mzazrivec/fix_ot_name
Browse files Browse the repository at this point in the history
Correctly render orchestration template's name
  • Loading branch information
martinpovolny authored Aug 9, 2018
2 parents 8a4b11e + 37ecf74 commit 4a1ed00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/orchestration_stack_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 8 additions & 1 deletion spec/controllers/orchestration_stack_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand All @@ -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("<h1>\ntemplate name")
expect(response.body).not_to include("<h1>\nstack01")
end
end
end

Expand Down

0 comments on commit 4a1ed00

Please sign in to comment.