# Failing test: "can find artists by partial name match" (page 169)

**URL:** <https://forum.devtalk.com/t/failing-test-can-find-artists-by-partial-name-match-page-169/185585>\
**Category:** PragProg Customers\
**Tags:** book-ash-framework, errata\
**Created:** [28 January 2025 08:19 UTC](https://forum.devtalk.com/t/failing-test-can-find-artists-by-partial-name-match-page-169/185585 "2025-01-28T08:19:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arcanemachine](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/a/e0b2c6/32.png) [@arcanemachine](https://forum.devtalk.com/u/arcanemachine)\
**Post date:** [28 January 2025 08:19 UTC](https://forum.devtalk.com/t/failing-test-can-find-artists-by-partial-name-match-page-169/185585/1 "2025-01-28T08:19:45Z")

</div>

When starting fresh with the `chapter-6` branch (commit hash `#bff7f585`), the second test in chapter 7 fails with the following error:

```auto
  1) test Tunez.Music.search_artists!/1-3 can find artists by partial name match (Tunez.Music.ArtistTest)
     test/tunez/music/artist_test.exs:14
     ** (Ash.Error.Forbidden) 
     Bread Crumbs:
       > Error returned from: Tunez.Music.Artist.create

     Forbidden Error

     * forbidden
       (ash 3.4.55) lib/ash/error/forbidden/policy.ex:9: Ash.Error.Forbidden.Policy."exception (overridable 2)"/1
       (ash 3.4.55) lib/ash/error/forbidden/policy.ex:31: Ash.Error.Forbidden.Policy.exception/1
       (ash 3.4.55) lib/ash/policy/authorizer/authorizer.ex:1727: Ash.Policy.Authorizer.handle_strict_check_result/2
       (ash 3.4.55) lib/ash/policy/authorizer/authorizer.ex:698: Ash.Policy.Authorizer.strict_check/2
       (ash 3.4.55) lib/ash/can.ex:498: anonymous fn/6 in Ash.Can.run_check/4
       (elixir 1.18.2) lib/enum.ex:4964: Enumerable.List.reduce/3
       (elixir 1.18.2) lib/enum.ex:2600: Enum.reduce_while/3
       (ash 3.4.55) lib/ash/can.ex:495: Ash.Can.run_check/4
       (ash 3.4.55) lib/ash/can.ex:163: Ash.Can.can/4
       (ash 3.4.55) lib/ash.ex:1349: Ash.can/3
       (ash 3.4.55) lib/ash/actions/create/create.ex:167: Ash.Actions.Create.authorize/2
       (ash 3.4.55) lib/ash/actions/create/create.ex:131: Ash.Actions.Create.do_run/4
       (ash 3.4.55) lib/ash/actions/create/create.ex:50: Ash.Actions.Create.run/4
       (ash 3.4.55) lib/ash.ex:2182: Ash.create!/3
       test/tunez/music/artist_test.exs:16: Tunez.Music.ArtistTest."test Tunez.Music.search_artists!/1-3 can find artists by partial name match"/1
       (ex_unit 1.18.2) lib/ex_unit/runner.ex:511: ExUnit.Runner.exec_test/2
       (stdlib 6.2) timer.erl:595: :timer.tc/2
       (ex_unit 1.18.2) lib/ex_unit/runner.ex:433: anonymous fn/6 in ExUnit.Runner.spawn_test_monitor/4
     code: Tunez.Music.create_artist!(%{
     stacktrace:
       (ash 3.4.55) lib/ash/error/forbidden.ex:3: Ash.Error.Forbidden.exception/1
       (ash 3.4.55) /home/tower/code/ash/tunez/deps/splode/lib/splode.ex:264: Ash.Error.to_class/2
       (ash 3.4.55) lib/ash/error/error.ex:108: Ash.Error.to_error_class/2
       (ash 3.4.55) lib/ash/actions/create/create.ex:155: Ash.Actions.Create.do_run/4
       (ash 3.4.55) lib/ash/actions/create/create.ex:50: Ash.Actions.Create.run/4
       (ash 3.4.55) lib/ash.ex:2182: Ash.create!/3
       test/tunez/music/artist_test.exs:16: (test)

```

---

<div class="post-metadata">

**Author:** ![sevenseacat](https://forum.devtalk.com/user_avatar/forum.devtalk.com/sevenseacat/32/5897_2.png) [@sevenseacat](https://forum.devtalk.com/u/sevenseacat)\
**Post date:** [30 January 2025 06:46 UTC](https://forum.devtalk.com/t/failing-test-can-find-artists-by-partial-name-match-page-169/185585/2 "2025-01-30T06:46:24Z")

</div>

It does too, it’s missing either generating a user and using them as the actor, or using `authorize?: false` 🙈 I’ll fix that, thank you!
