Sha256: 98f886a88c39839bfaa035ff85acd1d412b5a4252f87e5567d85514100611e36

Contents?: true

Size: 863 Bytes

Versions: 9

Compression:

Stored size: 863 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper'

require 'cerberus/publisher/jabber'
require 'cerberus/manager'
require 'mock/xmpp4r'
require 'mock/manager'

class JabberPublisherTest < Test::Unit::TestCase
  def test_publisher
    options = Cerberus::Config.new(nil, :publisher => {:jabber => {:jid=>'from.cerberus@gmail.com', :recipients => ' jit1@google.com, another@google.com '}}, :application_name => 'MegaApp')
    build = DummyManager.new('last message', 'this is output', 1232, 'anatol')

    Cerberus::Publisher::Jabber.publish(build_status(false), build, options)

    messages = Jabber::Client.messages
    assert messages.size > 2
    assert_equal 'google.com', messages[0].to.domain
    assert_equal 'jit1', messages[0].to.node
    assert_equal '[MegaApp] Build still broken (#1232)', messages[0].subject
    assert !messages[0].body.nil?
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cerberus-0.4.0 test/jabber_publisher_test.rb
cerberus-0.4.1 test/jabber_publisher_test.rb
cerberus-0.4.3 test/jabber_publisher_test.rb
cerberus-0.4.4 test/jabber_publisher_test.rb
cerberus-0.4.2 test/jabber_publisher_test.rb
cerberus-0.4.5.1 test/jabber_publisher_test.rb
cerberus-0.4.5 test/jabber_publisher_test.rb
cerberus-0.5 test/jabber_publisher_test.rb
cerberus-0.6 test/jabber_publisher_test.rb