Skip to content

Commit

Permalink
fix(has_result_steps): use unsafe attributes in to_kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
marian13 committed Feb 1, 2023
1 parent 8891247 commit 6c2b1d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ def ==(other)
# @return [Hash]
#
def to_kwargs
{service: service, status: status, data: data, message: message, code: code}
{
service: service,
status: status,
data: unsafe_data,
message: unsafe_message,
code: unsafe_code
}
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ class self::Internals
it "returns kwargs representation of result" do
expect(result.to_kwargs).to eq(kwargs)
end

specify { expect { result.to_kwargs }.to delegate_to(result, :unsafe_data) }
specify { expect { result.to_kwargs }.to delegate_to(result, :unsafe_message) }
specify { expect { result.to_kwargs }.to delegate_to(result, :unsafe_code) }
end
end
end
Expand Down

0 comments on commit 6c2b1d3

Please sign in to comment.