Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 32 lines (24 sloc) 0.591 kb
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 27 28 29 30 31 32
require File.expand_path('../helper', __FILE__)

class YammerTest < Service::TestCase
  def setup
    @stubs = Faraday::Adapter::Test::Stubs.new
  end

  def test_push
    svc = service({'group_id' => 'g'}, payload)

    def svc.messages
      @messages ||= []
    end

    def svc.send_message(params)
      messages << params
    end

    def svc.shorten_url(*args)
      'short'
    end

    svc.receive_push

    assert_equal 3, svc.messages.size
    assert_equal %w(g g g), svc.messages.map { |m| m['group_id'] }
  end

  def service(*args)
    super Service::Yammer, *args
  end
end
Something went wrong with that request. Please try again.