# Ash.Generator property testing for invalid inputs

**URL:** <https://forum.elixirforum.com/t/ash-generator-property-testing-for-invalid-inputs/64310>\
**Category:** Questions\
**Tags:** property-testing, ash\
**Created:** [June 18, 2024, 5:34am UTC](https://forum.elixirforum.com/t/ash-generator-property-testing-for-invalid-inputs/64310 "2024-06-18T05:34:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![zachdaniel](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/32/31980_2.png) [@zachdaniel](https://forum.elixirforum.com/u/zachdaniel)\
**Post date:** [June 18, 2024, 2:27pm UTC](https://forum.elixirforum.com/t/ash-generator-property-testing-for-invalid-inputs/64310/2 "2024-06-18T14:27:05Z")

</div>

I think the best approach here would be to modify the existing generators with invalid attribute generators. For example:

```elixir
    property "doesn't accept maps as input to text" do
      user = Domain.create_user!()

      check all(input <- Ash.Generator.action_input(Tweet, :create, %{text: StreamData.fixed_map(%{a: 1})})) do
        {text, other_inputs} = Map.pop!(input, :text)
        Domain.create_tweet!(text, other_inputs, authorize?: false, actor: user)
      end
    end

```

This particular one is a bit of a silly example, but the point was to illustrate that individual generators can be overridden with generators that produce whatever you like to test specific conditions.

Does that seem like it fits the bill of what you’re looking for?

---

_[View the full topic](https://forum.elixirforum.com/t/ash-generator-property-testing-for-invalid-inputs/64310)._
