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
672 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 'empty_text'
  6. def self.call(client, data, _match)
  7. send_message client, 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 'sends default text' do
  16. allow(Giphy).to receive(:random)
  17. expect(SlackRubyBot::Commands::Base).to receive(:send_message_with_gif).with(client, 'channel', 'Nothing to see here.', 'nothing', {})
  18. app.send(:message, client, text: "#{SlackRubyBot.config.user} empty_text", channel: 'channel', user: 'user')
  19. end
  20. end