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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user