Skip to content

Commit

Permalink
specs for payload_template
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrock committed May 22, 2024
1 parent 204b7e7 commit 67e7a44
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions spec/workflow/payload_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@
let(:subject) { described_class.new(payload) }

describe "#value" do
context "with static array" do
let(:payload) { ["a", 2] }
let(:context) { {} }

it "returns the original value" do
expect(subject.value(context)).to eq(["a", 2])
end
end

context "with static values" do
let(:payload) { {"foo" => "bar", "bar" => "$.baz"} }
let(:payload) { {"foo" => "bar", "bar" => "$.baz", "baz" => 3} }
let(:context) { {} }

it "returns the original value" do
expect(subject.value(context)).to eq({"foo" => "bar", "bar" => "$.baz"})
expect(subject.value(context)).to eq({"foo" => "bar", "bar" => "$.baz", "baz" => 3})
end
end

Expand Down

0 comments on commit 67e7a44

Please sign in to comment.