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
824 B

  1. require 'spec_helper'
  2. describe SlackMathbot::Commands::Calculate, vcr: { cassette_name: 'user_info' } do
  3. it 'adds two numbers' do
  4. expect(message: 'mathbot calculate 2+2', channel: 'channel').to respond_with_slack_message('4')
  5. end
  6. it 'adds two numbers via =' do
  7. expect(message: '= 2+2', channel: 'channel').to respond_with_slack_message('4')
  8. end
  9. it 'adds two numbers via = without a space' do
  10. expect(message: '=2+2', channel: 'channel').to respond_with_slack_message('4')
  11. end
  12. it 'sends something without an answer' do
  13. expect(message: 'mathbot calculate pi', channel: 'channel').to respond_with_slack_message('Got nothing.')
  14. end
  15. it 'reports division by zero' do
  16. expect(message: 'mathbot calculate 1/0', channel: 'channel').to respond_with_slack_message('Sorry, divided by 0.')
  17. end
  18. end