fix: make tweet_like tests pass

- Add authorize?: false to user_fixture so register_with_password
  bypasses policy check in test context
- Add require Ash.Query so Ash.Query.filter macro works in count_likes
- Replace nonexistent Ash.ForbiddenField.forbidden?/1 with match?/2
- Fix stale tweet struct in :like noop case by reloading from DB

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-12 19:48:23 -04:00
parent 88e84fcec5
commit 4c67f38fa3
2 changed files with 5 additions and 4 deletions

View File

@@ -127,7 +127,7 @@ defmodule Mixer.Posts.Tweet do
increment_likes(tweet, context.actor)
{:noop, _like} ->
{:ok, tweet}
Ash.get(__MODULE__, tweet.id, authorize?: false)
{:error, error} ->
{:error, error}