Skip to content

Commit

Permalink
Merge pull request #766 from zakiva/fix_cu_link
Browse files Browse the repository at this point in the history
Fix Container Provider link to Capacity & Utilization
(cherry picked from commit a6a04eb)

https://bugzilla.redhat.com/show_bug.cgi?id=1436233
  • Loading branch information
Martin Povolny authored and simaishi committed Apr 28, 2017
1 parent 5d595b1 commit 242d5fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/layouts/listnav/_ems_container.html.haml
Expand Up @@ -11,7 +11,7 @@
- if @record.has_perf_data?
%li
= link_to(_('Capacity & Utilization'),
{:action => 'show', :id => @record, :display => 'performance'},
polymorphic_path(@record, :display => "performance"),
:title => _("Show Capacity & Utilization"))
- else
%li.disabled
Expand Down
18 changes: 18 additions & 0 deletions spec/views/layouts/listnav/_ems_container.html.haml_spec.rb
@@ -0,0 +1,18 @@
describe "layouts/listnav/_ems_container.html.haml" do
helper(QuadiconHelper)

before :each do
set_controller_for_view("ems_container")
assign(:panels, "ems_prop" => true, "ems_rel" => true)
allow(view).to receive(:truncate_length).and_return(10)
allow(view).to receive(:role_allows?).and_return(true)
end

it "link to Capacity & Utilization uses restful path" do
@record = FactoryGirl.create(:ems_openshift)
allow(@record).to receive(:has_perf_data?).and_return(true)
render
expect(response)
.to include("Show Capacity & Utilization\" href=\"/ems_container/#{@record.id}?display=performance\">")
end
end

0 comments on commit 242d5fa

Please sign in to comment.