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.

19 lines
637 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 'send_message_spec' do |client, data, match|
  6. send_message client, data.channel, match['expression']
  7. end
  8. end
  9. end
  10. def app
  11. SlackRubyBot::App.new
  12. end
  13. let(:client) { app.send(:client) }
  14. it 'sends a message' do
  15. expect(SlackRubyBot::Commands::Base).to receive(:send_client_message).with(client, channel: 'channel', text: 'message')
  16. app.send(:message, client, text: "#{SlackRubyBot.config.user} send_message_spec message", channel: 'channel', user: 'user')
  17. end
  18. end