arcanemachine

arcanemachine

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

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

  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)

Most Liked

sevenseacat

sevenseacat

Author of Ash Framework

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

Where Next?

Popular Pragmatic Bookshelf topics Top

simonpeter
When I try the command to create a pair of migration files I get an error. user=> (create-migration "guestbook") Execution error (Ill...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
New
oaklandgit
Hi, I completed chapter 6 but am getting the following error when running: thread 'main' panicked at 'Failed to load texture: IoError(O...
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New
dtonhofer
@parrt In the context of Chapter 4.3, the grammar Java.g4, meant to parse Java 6 compilation units, no longer passes ANTLR (currently 4....
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1139 25503 755
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New

Sub Categories: