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)
1 25 1

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!

Popular Prag Prog topics Top

jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
8 1915 7
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
2 1436 3
New
jskubick
I’m running Android Studio “Arctic Fox” 2020.3.1 Patch 2, and I’m embarrassed to admit that I only made it to page 8 before running into ...
0 1695 3
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...
0 3915 1
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...
2 1302 3
New
AufHe
I’m a newbie to Rails 7 and have hit an issue with the bin/Dev script mentioned on pages 112-113. Iteration A1 - Seeing the list of prod...
0 2609 9
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 ...
6 1109 5
New
EdBorn
Title: Agile Web Development with Rails 7: (page 70) I am running windows 11 pro with rails 7.0.3 and ruby 3.1.2p20 (2022-04-12 revision...
0 1125 1
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....
0 1003 3
New
dachristenson
I just bought this book to learn about Android development, and I’m already running into a major issue in Ch. 1, p. 20: “Update activity...
0 1984 6
New

Other popular topics Top

AstonJ
Or looking forward to? :nerd_face:
480 9107 251
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
227 8356 88
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
236 5547 90
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
14 7501 8
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
82 6614 31
New
OvermindDL1
Woooooooo! This is such a huge release for it, and 2 years incoming! In short, the library is now using an updated hyper backend (not j...
20 2656 6
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
91 4884 43
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
19 2841 10
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
52 4591 22
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...
16 3805 11
New

Latest in PragProg

View all threads ❯