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 a6abff8
Showing 1 changed file with 4 additions and 4 deletions.
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 a6abff8

Please sign in to comment.