Permalink
Browse files

Adds HuBoard integration

  • Loading branch information...
rauhryan committed Dec 20, 2013
1 parent 103e554 commit 3bcb0efc6b48c9e5824314b2830b0ad50c7dc468
Showing with 67 additions and 0 deletions.
  1. +12 −0 docs/huboard
  2. +21 −0 lib/services/huboard.rb
  3. +34 −0 test/huboard_test.rb
View
@@ -0,0 +1,12 @@
+HuBoard
+=======
+
+## Instant project management for you GitHub repositories
+
+See: https://huboard.com
+
+HuBoard is built from the ground up using the GitHub public API. HuBoard issues **are** GitHub issues, you will never
+have to deal with syncronization problems. Keep you issues where they belong, in the repository with you code.
+
+By enabling GitHub's Service Hook integration, HuBoard keeps your agile boards up to date by sending events that occur
+on GitHub directly to HuBoard.
View
@@ -0,0 +1,21 @@
+class Service::HuBoard < Service::HttpPost
+
+ default_events :issue_comment, :issues
+
+ url "https://huboard.com"
+ logo_url "https://img/LogoFullPurpleLight.png"
+ maintained_by :github => 'rauhryan'
+ supported_by :email => 'huboard@huboard.com'
+
+ HUBOARD_URL = "http://live.huboard.com"
+
+ def receive_issues
+ http_post "#{HUBOARD_URL}/issue/webhook", :payload => generate_json(payload)
+ end
+
+ def receive_issue_comment
+ http_post "#{HUBOARD_URL}/comment/webhook", :payload => generate_json(payload)
+ end
+
+end
+
View
@@ -0,0 +1,34 @@
+require File.expand_path('../helper', __FILE__)
+
+class HuBoardTest < Service::TestCase
+ def setup
+ @stubs = Faraday::Adapter::Test::Stubs.new
+ end
+
+ def test_issues
+ @stubs.post "/issue/webhook" do |env|
+ assert_equal 'live.huboard.com', env[:url].host
+ assert_equal 'application/x-www-form-urlencoded',
+ env[:request_headers]['content-type']
+ [200, {}, '']
+ end
+
+ service(issues_payload).receive_issues
+ end
+
+ def test_comment
+ @stubs.post "/comment/webhook" do |env|
+ assert_equal 'live.huboard.com', env[:url].host
+ assert_equal 'application/x-www-form-urlencoded',
+ env[:request_headers]['content-type']
+ [200, {}, '']
+ end
+
+ service(issue_comment_payload).receive_issue_comment
+ end
+
+ def service(payload)
+ super Service::HuBoard, {}, payload
+ end
+end
+

0 comments on commit 3bcb0ef

Please sign in to comment.