Skip to content

Commit

Permalink
Fix dialog tag specs
Browse files Browse the repository at this point in the history
  • Loading branch information
GilbertCherrie committed Aug 21, 2024
1 parent f65c6d1 commit f7f5bc1
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 5 deletions.
104 changes: 104 additions & 0 deletions .byebug_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
c
build_tags_for_provisioning(@edit[:wf], @edit[:new][:vm_tags], true)
@edit[:new][:vm_tags]
@edit[:new][:current_tab_key]
@edit = session[:edit]
@edit[:new][:current_tab_key]
session[:edit][:req_id]
params
session[:edit]
c
fetch_name_from_object(ManageIQ::Providers::ExternalAutomationManager::ConfigurationScript, options[:ansible_template_id]) if options[:ansible_template_id]
record
c
record
if location == "ansible_workflow_template"
ManageIQ::Providers::ExternalAutomationManager::ConfigurationWorkflow.find_by(:id => ansible_template_id)&.manager&.name
else
ManageIQ::Providers::ExternalAutomationManager::ConfigurationScript.find_by(:id => ansible_template_id)&.manager&.name
end
record
ManageIQ::Providers::ExternalAutomationManager::ConfigurationScript.find_by(:id => ansible_template_id)&.manager&.name
fetch_manager_name(options[:ansible_template_id])
record.name
record
c
options = @record.options
options = record.options
@record
@playbook_details
c
method
method&.options[:ansible_template_id]
c
manager_id = ManageIQ::Providers::ExternalAutomationManager::ConfigurationWorkflow
.find_by(:id => method.options[:ansible_template_id])&.manager_id
ManageIQ::Providers::ExternalAutomationManager::ConfigurationScript
.find_by(:id => method.options[:ansible_template_id])
ManageIQ::Providers::ExternalAutomationManager::ConfigurationScript
.find_by(:id => method.options[:ansible_template_id])&.manager_id
method
c
MiqAeMethod.find(params[:id])
method = MiqAeMethod.find(params[:id])
method
MiqAeMethod.find(params[:id])
method = MiqAeMethod.find(params[:id])
method
method = MiqAeMethod.find(params[:id])
MiqAeMethod.find(params[:id])
params
method
method = MiqAeMethod.find(params[:id])
method = MiqAeMethod.find(params[:id])
c
params
c
params
c
params
c
params
c
params
c
params
c
set_playbook_data
params
c
list_of_managers
list_of_managers = []
ManageIQ::Providers::ExternalAutomationManager.where(:enabled => true).each do |provider|
byebug
list_of_managers.push({:id => provider.id, :name => provider.name})
end
list_of_managers[2].name
list_of_managers[2]
list_of_managers = ManageIQ::Providers::ExternalAutomationManager
.where(:enabled => true)
ManageIQ::Providers::ExternalAutomationManager
.where(:enabled => true)
c
record.class.method(:name)
record.class.method(:name).source_location
record.class.method(:name)
record.class.method(:name).source_location
record.class.method(:name).source_lication
Record.class.method(:name).source_lication
c
record.name
record
c
@record.name
@record
@record.keys
@record.name
@record
c
@ems
c
@ems
c
@ems
c
2 changes: 1 addition & 1 deletion app/models/service_orchestration/provision_tagging.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ServiceOrchestration::ProvisionTagging
DIALOG_TAG_KEY_REGEX = /^Array::dialog_tag_(?<sequence>\d*)_(?<option_key>.*)/i
DIALOG_TAG_KEY_REGEX = /^dialog_tag_(?<sequence>\d*)_(?<option_key>.*)/i
DIALOG_TAG_VALUE_REGEX = /Classification::(\d*)/

private
Expand Down
2 changes: 1 addition & 1 deletion spec/models/dialog_field_tag_control_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def add_entry(cat, options)
it "automate_output_value with an single value" do
tag = Classification.first
@df.value = tag.id.to_s
expect(@df.automate_output_value).to eq("#{tag.class.name}::#{tag.id}")
expect(@df.automate_output_value).to eq(["#{tag.class.name}::#{tag.id}"])
end

it "automate_output_value with multiple values" do
Expand Down
6 changes: 3 additions & 3 deletions spec/models/service_orchestration/provision_tagging_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
let(:service) { FactoryBot.build(:service_orchestration, :miq_request_task => miq_request_task) }
let(:dialog_tag_options) do
{:dialog => {
'Array::dialog_tag_0_env' => 'Classification::1',
'Array::dialog_tag_1_network' => 'Classification::11',
'Array::dialog_tag_2_dept' => 'Classification::21,Classification::22,Classification::23'
'dialog_tag_0_env' => 'Classification::1',
'dialog_tag_1_network' => 'Classification::11',
'dialog_tag_2_dept' => 'Classification::21,Classification::22,Classification::23'
}}
end

Expand Down

0 comments on commit f7f5bc1

Please sign in to comment.