Testing `Ash.Resource.Change` in Isolation

I'm starting to break up my resources into separate modules using Ash.Resource.Change and it's occurring to me it shouldn't be too difficult to test those modules in isolation. If I have an Ash.Resource.Change that just runs an after_transaction hook, how do I trigger that function directly?
Solution:
At that point I might just make the function you pass to after_action a public function on the module and test that. At least I don't know of a good way to trigger the after action without running the whole action
Jump to solution
2 Replies
⿻ eileen
⿻ eileenOP3mo ago
I am pretty sure I could just make the callback function public and execute it directly. Wondering what's the Ash way to directly run a change
Solution
barnabasj
barnabasj3mo ago
At that point I might just make the function you pass to after_action a public function on the module and test that. At least I don't know of a good way to trigger the after action without running the whole action

Did you find this page helpful?