Permalink
Browse files

Respond to GET requests

This should improve debugging for new users ever so slightly. It might prove to be a great hook for further debugging info as well
  • Loading branch information...
1 parent 0459aee commit 04bde13a58b6de7f4b55e66405282d536d8e96fb @koppen committed Oct 24, 2011
Showing with 12 additions and 5 deletions.
  1. +7 −5 app/controllers/github_hook_controller.rb
  2. +5 −0 test/functional/github_hook_controller_test.rb
@@ -5,13 +5,15 @@ class GithubHookController < ApplicationController
skip_before_filter :verify_authenticity_token, :check_if_login_required
def index
- repository = find_repository
+ if request.post?
+ repository = find_repository
- # Fetch the changes from Github
- update_repository(repository)
+ # Fetch the changes from Github
+ update_repository(repository)
- # Fetch the new changesets into Redmine
- repository.fetch_changesets
+ # Fetch the new changesets into Redmine
+ repository.fetch_changesets
+ end
render(:text => 'OK')
end
@@ -176,4 +176,9 @@ def test_exec_should_log_output_from_git_as_error_when_things_go_sour
do_post
end
+ def test_should_respond_to_get
+ get :index
+ assert_response :success
+ end
+
end

0 comments on commit 04bde13

Please sign in to comment.