Skip to content

Commit

Permalink
Merge pull request #1086 from lgalis/foreman_url_sort_spec
Browse files Browse the repository at this point in the history
Spec for configuration manager providers sort by url
(cherry picked from commit 7769b5c)

https://bugzilla.redhat.com/show_bug.cgi?id=1444180
  • Loading branch information
h-kataria authored and simaishi committed Apr 24, 2017
1 parent 5426739 commit 537fe10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/layouts/listnav/_configuration_job.html.haml
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions spec/controllers/provider_foreman_controller_spec.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 537fe10

Please sign in to comment.