Open cabello opened 5 years ago
Attempt 2 and 3 are both feature requests and we should have that. Want to attempt a PR?
Generally I'd like .to respond_with_slack_message
or .to respond_with_slack_messages
to work without arguments as well. That could be a lower hanging fruit.
Implemented in https://github.com/slack-ruby/slack-ruby-bot/pull/216.
Hi π
I have a scenario where the bot answers with two messages and the test is asserting measurements are being taken.
In this specific scenario I do not care about the bot's response, I just want to send the bot a message and assert, given the setup is a bit complex for that I would like to reuse whatever was already written for
respond_with_slack_message
(singular or plural form).Attempt 1
Use the plural form
respond_with_slack_messages
withanything
:I get the following failure:
Attempt 2
Use the plural form
respond_with_slack_messages
with[anything, anything]
:I get the following failure:
Attempt 3
Use the singular form
respond_with_slack_message
withanything
:I get the following failure:
For now I decided to extract a variable called
expected_messages
and I assert them multiple times, once for the real response, others for behaviour like the analytical measurements.