Skip to content

Commit

Permalink
Merge pull request ManageIQ#1029 from lgalis/fix_textual_provider_svg…
Browse files Browse the repository at this point in the history
…_and_controller_for_ansible_job

Fix the controller and svg in textual provider for Ansible Tower Jobs
  • Loading branch information
Dan Clarizio authored Apr 13, 2017
2 parents 612d662 + 6fc0cfc commit a965a4f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/helpers/configuration_job_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ def textual_service
end

def textual_provider
h = {:label => _("Provider"), :image => "svg/vendor-automation_manager_configuration.svg"}
h = {:label => _("Provider"), :image => "svg/vendor-ansible.svg"}
provider = @record.ext_management_system
if provider.nil?
h[:value] = _("None")
else
h[:value] = provider.name
h[:title] = _("Show this Parent Provider")
h[:link] = url_for_only_path(:controller => 'provider_foreman', :action => 'explorer', :id => "at-#{to_cid(provider.id)}")
h[:link] = url_for_only_path(:controller => 'automation_manager', :action => 'explorer', :id => "at-#{to_cid(provider.id)}")
end
h
end
Expand Down
14 changes: 14 additions & 0 deletions spec/helpers/configuration_job_helper/textual_summary_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe ConfigurationJobHelper::TextualSummary do
include CompressedIds
include ApplicationHelper

let(:zone) { EvmSpecHelper.local_miq_server.zone }
let(:automation_provider) { FactoryGirl.create(:provider_ansible_tower, :name => "ansibletest", :url => "test", :zone => zone) }

it "#textual_provider" do
manager = ManageIQ::Providers::AnsibleTower::AutomationManager.find_by(:provider_id => automation_provider.id)
@record = FactoryGirl.create(:ansible_tower_job, :ext_management_system => manager)
expect(textual_provider[:image]).to eq("svg/vendor-ansible.svg")
expect(textual_provider[:link]).to eq("/automation_manager/explorer/at-#{to_cid(manager.id)}")
end
end

0 comments on commit a965a4f

Please sign in to comment.