File: dm_spec.rb

package info (click to toggle)
atig 0.6.1-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 868 kB
  • sloc: ruby: 5,315; makefile: 11; sh: 3
file content (26 lines) | stat: -rw-r--r-- 742 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- mode:ruby; coding:utf-8 -*-

require 'atig/command/dm'

describe Atig::Command::Dm do
  include CommandHelper
  before do
    @command = init Atig::Command::Dm
  end

  it "should have '/me dm' name" do
    expect(@gateway.names).to eq(['d', 'dm','dms'])
  end

  it "should post the status by API" do
    expect(@api).to receive(:post).with('direct_messages/new',
                                    {screen_name: 'mzp', text: 'blah blah'})
    expect(@channel).to receive(:notify).with("Sent message to mzp: blah blah")
    call '#twitter', "dm", %w(mzp blah blah)
  end

  it "should post the status by API" do
    expect(@channel).to receive(:notify).with("/me dm <SCREEN_NAME> blah blah")
    call '#twitter', "dm", %w()
  end
end