You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require_relative '../commands/support'
require 'pry'
describe MyBot::Commands::Support do
it 'gives support link' do
expect(message: "#{SlackRubyBot.config.user} support").to respond_with_slack_message(/support url/)
end
end
1) MyBot::Commands::Support gives support link
Failure/Error: client.channels.dig(data.channel, :name)
NoMethodError:
undefined method `dig' for nil:NilClass
Whereas I'm expecting to get a green passing test.
In order to get over the error I think I need to connect to slack but I can’t find the proper documentation for doing so.
Thanks
The text was updated successfully, but these errors were encountered:
The RTM client's .channels is something that comes from a local store. Since we are not actually starting a client we either need to stub that store in tests or default it. I think it's a bug either way. I'm happy to take a PR for either code or docs.
Hi,
When trying to rspec test a command such as:
with the following spec file:
and spec_helper:
When running rspec I get:
Whereas I'm expecting to get a green passing test.
In order to get over the error I think I need to connect to slack but I can’t find the proper documentation for doing so.
Thanks
The text was updated successfully, but these errors were encountered: