Skip to content

Conversation

rrothenberger
Copy link

Resolves: #492 - at least to the best of my ability 😅

Comment on lines +218 to +236
context "with meta-data and arg type" do
it "returns a template for a specific rule, meta and default arg type" do
store_errors(
predicate_with_meta: {
arg: {
default: {
text: "text %{arg}",
code: 123
}
}
}
)

template, meta = messages[:predicate_with_meta, path: :pages, locale: :en]

expect(template.(arg: "some arg")).to eql("text some arg")
expect(meta).to eq({code: 123})
end
end
Copy link
Author

@rrothenberger rrothenberger Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I wanted to jest drop the logic around text_key in lib/dry/schema/messages/i18n.rb - but it was making this possible and there might be people relying on this behavior so I thought it was worth to add test for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I18n nested text and missing options when using lambda
1 participant