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

yulkin
your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
New
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
mikecargal
Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) It looks like ​.with_simple_console_no_bg​(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New
joepstender
The generated iex result below should list products instead of product for the metadata. (page 67) iex> product = %Product{} %Pento....
New
Chrichton
Dear Sophie. I tried to do the “Authorization” exercise and have two questions: When trying to plug in an email-service, I found the ...
New
leonW
I ran this command after installing the sample application: $ cards add do something --owner Brian And got a file not found error: Fil...
New
brunogirin
When I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New
creminology
Skimming ahead, much of the following is explained in Chapter 3, but new readers (like me!) will hit a roadblock in Chapter 2 with their ...
New
mert
AWDWR 7, page 152, page 153: Hello everyone, I’m a little bit lost on the hotwire part. I didn’t fully understand it. On page 152 @rub...
New

Other popular topics Top

wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
New
PragmaticBookshelf
Create efficient, elegant software tests in pytest, Python's most powerful testing framework. Brian Okken @brianokken Edited by Kat...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New
PragmaticBookshelf
Fight complexity and reclaim the original spirit of agility by learning to simplify how you develop software. The result: a more humane a...
New

Sub Categories: