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.

38 lines
1.7 KiB

9 years ago
  1. require 'spec_helper'
  2. describe SlackRubyBot do
  3. def app
  4. SlackRubyBot::App.new
  5. end
  6. context 'it responds to direct messages' do
  7. it 'with bot name' do
  8. expect(message: "#{SlackRubyBot.config.user} hi", channel: 'DEADBEEF').to respond_with_slack_message('Hi <@user>!')
  9. end
  10. it 'with bot name capitalized' do
  11. expect(message: "#{SlackRubyBot.config.user.upcase} hi", channel: 'DEADBEEF').to respond_with_slack_message('Hi <@user>!')
  12. end
  13. it 'with bot user id' do
  14. expect(message: "<@#{SlackRubyBot.config.user_id}> hi", channel: 'DEADBEEF').to respond_with_slack_message('Hi <@user>!')
  15. end
  16. it 'without bot name' do
  17. expect(message: 'hi', channel: 'DEADBEEF').to respond_with_slack_message('Hi <@user>!')
  18. end
  19. end
  20. context 'it responds to direct name calling' do
  21. it 'with bot name' do
  22. expect(message: "#{SlackRubyBot.config.user}", channel: 'DEADBEEF').to respond_with_slack_message(SlackRubyBot::ABOUT)
  23. end
  24. it 'with bot name capitalized' do
  25. expect(message: "#{SlackRubyBot.config.user.upcase}", channel: 'DEADBEEF').to respond_with_slack_message(SlackRubyBot::ABOUT)
  26. end
  27. it 'with bot user id' do
  28. expect(message: "<@#{SlackRubyBot.config.user_id}>", channel: 'DEADBEEF').to respond_with_slack_message(SlackRubyBot::ABOUT)
  29. end
  30. it 'with bot user id and a colon' do
  31. expect(message: "<@#{SlackRubyBot.config.user_id}>:", channel: 'DEADBEEF').to respond_with_slack_message(SlackRubyBot::ABOUT)
  32. end
  33. it 'with bot user id and a colon and a space' do
  34. expect(message: "<@#{SlackRubyBot.config.user_id}>: ", channel: 'DEADBEEF').to respond_with_slack_message(SlackRubyBot::ABOUT)
  35. end
  36. end
  37. end