forked from transifex/txgh
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding github ping handler so setting up a new webhook doesn't fail right away * Remove unused helper
- Loading branch information
Showing
5 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module Txgh | ||
module Handlers | ||
module Github | ||
# Handles github's ping event, which is a test event fired whenever a new | ||
# webhook is set up. | ||
class PingHandler | ||
include ResponseHelpers | ||
|
||
def initialize(options = {}) | ||
end | ||
|
||
def execute | ||
respond_with(200, {}) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'spec_helper' | ||
|
||
include Txgh | ||
include Txgh::Handlers::Github | ||
|
||
describe PingHandler do | ||
let(:handler) do | ||
PingHandler.new | ||
end | ||
|
||
it 'responds with a 200 success' do | ||
response = handler.execute | ||
expect(response.status).to eq(200) | ||
expect(response.body).to eq({}) | ||
end | ||
end |