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 Jul 3, 2024
1 parent 77e5f7a commit fe3a3c3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .byebug_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
c
expect(@df.automate_output_value).to eq("#{tag.id}")
expect(@df.automate_output_value).to match_array(tags.collect { |tag| "#{tag.id}" })
@df.automate_output_value
c
@df.automate_output_value
c
@df.automate_output_value
expect(@df.automate_output_value).to match_array(tags.collect { |tag| "#{tag.class.name}::#{tag.id}" })
@df.automate_output_value
c
@df.automate_output_value
def automate_output_value
MiqAeEngine.create_automation_attribute_array_value(Classification.where(:id => @value.kind_of?(String) ? @value.split(',') : @value))
end
tags
@df.automate_output_value
@df.value
@df
Empty file removed data/git_repos/locks/.gitkeep
Empty file.
8 changes: 4 additions & 4 deletions spec/models/dialog_field_tag_control_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def add_entry(cat, options)
end

it "#automate_key_name" do
expect(@df.automate_key_name).to eq("Array::dialog_#{@df.name}")
expect(@df.automate_key_name).to eq("dialog_#{@df.name}")
end

describe "#initialize_with_values" do
Expand Down Expand Up @@ -133,19 +133,19 @@ def add_entry(cat, options)
end

it "automate_output_value with an empty value" do
expect(@df.automate_output_value).to eq("")
expect(@df.automate_output_value).to eq([])
end

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.id.to_s])
end

it "automate_output_value with multiple values" do
tags = [Classification.first, Classification.last]
@df.value = tags.collect(&:id).join(",")
expect(@df.automate_output_value.split("\x1F")).to match_array(tags.collect { |tag| "#{tag.class.name}::#{tag.id}" })
expect(@df.automate_output_value).to match_array(tags.collect { |tag| tag.id.to_s })
end
end
end
Expand Down

0 comments on commit fe3a3c3

Please sign in to comment.