Sha256: 3851251ce09e644e86b60081bfd76c32af0ab749a861d590d996d7531386c666

Contents?: true

Size: 621 Bytes

Versions: 2

Compression:

Stored size: 621 Bytes

Contents

require 'spec_helper'

describe SlackRubyBot::Commands do
  let! :command do
    Class.new(SlackRubyBot::Commands::Base) do
      command 'empty_text'

      def self.call(client, data, _match)
        client.say(channel: data.channel)
      end
    end
  end
  def app
    SlackRubyBot::App.new
  end
  let(:client) { app.send(:client) }
  it 'sends default text' do
    allow(Giphy).to receive(:random)
    expect(client).to receive(:message).with(channel: 'channel', text: '')
    app.send(:message, client, Hashie::Mash.new(text: "#{SlackRubyBot.config.user} empty_text", channel: 'channel', user: 'user'))
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slack-ruby-bot-0.7.0 spec/slack-ruby-bot/commands/empty_text_spec.rb
slack-ruby-bot-0.6.2 spec/slack-ruby-bot/commands/empty_text_spec.rb