Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec for configuration manager providers sort by url #1086

Merged
merged 1 commit into from
Apr 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/layouts/listnav/_configuration_job.html.haml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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