Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 16 lines (12 sloc) 0.448 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
require File.dirname(__FILE__) + '/helper'

class TestWebhook < Test::Unit::TestCase
  def setup
    @webhook = God::Contacts::Webhook.new
  end

  def test_notify
    @webhook.url = 'http://example.com/switch'
    Net::HTTP.any_instance.expects(:request).returns(Net::HTTPSuccess.new('a', 'b', 'c'))

    @webhook.notify('msg', Time.now, 'prio', 'cat', 'host')
    assert_equal "sent webhook to http://example.com/switch", @webhook.info
  end
end
Something went wrong with that request. Please try again.