From 537fe10c64b8286630ecd0c12e65c057ded94040 Mon Sep 17 00:00:00 2001 From: Harpreet Kataria Date: Fri, 21 Apr 2017 17:30:39 -0400 Subject: [PATCH] Merge pull request #1086 from lgalis/foreman_url_sort_spec Spec for configuration manager providers sort by url (cherry picked from commit 7769b5cad7cb8623009de2e6e5573cf68a92f590) https://bugzilla.redhat.com/show_bug.cgi?id=1444180 --- app/views/layouts/listnav/_configuration_job.html.haml | 2 +- spec/controllers/provider_foreman_controller_spec.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/listnav/_configuration_job.html.haml b/app/views/layouts/listnav/_configuration_job.html.haml index a7a6fdb7351..ccecb3f49ed 100644 --- a/app/views/layouts/listnav/_configuration_job.html.haml +++ b/app/views/layouts/listnav/_configuration_job.html.haml @@ -15,7 +15,7 @@ - if role_allows?(:feature => "provider_foreman_view") && @record.ext_management_system %li = link_to("#{ui_lookup(:model => @record.ext_management_system.class.to_s)}: #{@record.ext_management_system.name}", - {:controller => "provider_foreman", :action => 'explorer', :id => "at-#{to_cid(@record.ext_management_system.id)}"}, + {:controller => "automation_manager", :action => 'explorer', :id => "at-#{to_cid(@record.ext_management_system.id)}"}, :title => _("Show parent %s for this Job") % ui_lookup(:model => @record.ext_management_system.class.to_s)) - if role_allows?(:feature => "service_view") && @record.service %li diff --git a/spec/controllers/provider_foreman_controller_spec.rb b/spec/controllers/provider_foreman_controller_spec.rb index d086f2f0293..6dd21d746da 100644 --- a/spec/controllers/provider_foreman_controller_spec.rb +++ b/spec/controllers/provider_foreman_controller_spec.rb @@ -60,6 +60,16 @@ expect(response.body).to_not be_empty end + it "renders explorer sorted by url" do + login_as user_with_feature(%w(providers_accord configured_systems_filter_accord)) + FactoryGirl.create(:provider_foreman, :name => "foremantest1", :url => "z_url") + FactoryGirl.create(:provider_foreman, :name => "foremantest2", :url => "a_url") + + get :explorer, :params => {:sortby => '2'} + expect(response.status).to eq(200) + expect(response.body).to match('a_url(.|\n)*z_url') + end + context "renders explorer based on RBAC" do it "renders explorer based on RBAC access to feature 'configured_system_tag'" do login_as user_with_feature %w(configured_system_tag)