Skip to content

Commit

Permalink
Add a missing test case for the use of _value_ in KeyValueStoreAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
knu committed Apr 15, 2023
1 parent d72cd28 commit 7ba2961
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions spec/models/agents/key_value_store_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,32 @@ def create_event(payload)
}
)
end

describe "using _value_" do
let(:value_template) { "{% if _value_ %}{{ _value_ }}, {% endif %}{{ name }}" }

it "represents the existing value" do
agent.receive(events[0..2])

expect(agent.reload.memory).to match(
{
"1" => "foo",
"2" => "bar",
"3" => "baz",
}
)

agent.receive([events[3]])

expect(agent.reload.memory).to match(
{
"1" => "foo, FOO",
"2" => "bar",
"3" => "baz",
}
)
end
end
end

describe "control target" do
Expand Down

0 comments on commit 7ba2961

Please sign in to comment.