Assertions for the Slackbox.Adapters.Test adapter, in the spirit of
Swoosh.TestAssertions. import it in your test module:
import Slackbox.TestAssertions
test "notifies #alerts" do
MyApp.Notifier.on_failure(build)
assert_message_sent(channel: "#alerts", text: ~r/failed/)
endAttribute assertions match against the first matching captured message (assertions are non-destructive).
A Regex value is matched with =~; any other value with ==. A 1-arity function is called with the
%Slackbox.Message{} for custom assertions.
Summary
Functions
Assert a post_ephemeral was sent.
Assert a post_message was sent, matching attrs (keyword) or a predicate fn.
Assert a chat.update was sent.
Assert views.open happened; the predicate receives %{trigger_id:, view:, opts:}.
Refute that any captured post_message matches attrs (default: refute any was sent).
Functions
Assert a post_ephemeral was sent.
Assert a post_message was sent, matching attrs (keyword) or a predicate fn.
Assert a chat.update was sent.
Assert views.open happened; the predicate receives %{trigger_id:, view:, opts:}.
Refute that any captured post_message matches attrs (default: refute any was sent).