A Slack Bot that pulls Pixiv information and posts the full image(s) into Slack, with iOS shortcuts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
577 B

9 years ago
  1. require 'spec_helper'
  2. describe SlackRubyBot::Commands do
  3. let! :command do
  4. Class.new(SlackRubyBot::Commands::Base) do
  5. command 'nil_text'
  6. def self.call(_client, data, _match)
  7. send_message cilent, data.channel, nil
  8. end
  9. end
  10. end
  11. def app
  12. SlackRubyBot::App.new
  13. end
  14. let(:client) { app.send(:client) }
  15. it 'ignores nil messages' do
  16. allow(Giphy).to receive(:random)
  17. expect(SlackRubyBot::Commands::Base).to_not receive(:send_message_with_gif)
  18. app.send(:message, client, text: nil, channel: 'channel', user: 'user')
  19. end
  20. end