Permalink
Browse files

Update to work with Redmine 1.4

  • Loading branch information...
1 parent 1335986 commit 15dafebb1adc359c0a58018b81d8c0608dd67162 @koppen committed May 8, 2012
@@ -20,6 +20,10 @@ def index
private
+ def system(*args)
+ Kernel.system(args)
+ end
+
# Executes shell command. Returns true if the shell command exits with a success status code
def exec(command)
logger.debug { "GithubHook: Executing command: '#{command}'" }
View
@@ -1,4 +1,3 @@
-ActionController::Routing::Routes.draw do |map|
- map.connect 'github_hook', :controller => 'github_hook', :action => 'index',
- :conditions => {:method => :post}
+RedmineApp::Application.routes.draw do
+ match 'github_hook' => 'github_hook#index', :via => [:post]
end
@@ -1,5 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
+require 'test/unit'
require 'mocha'
class GithubHookControllerTest < ActionController::TestCase
@@ -55,8 +56,7 @@ def setup
Project.stubs(:find_by_identifier).with('github').returns(@project)
# Make sure we don't run actual commands in test
- Kernel.stubs(:system)
-
+ @controller.expects(:system).never
Repository.expects(:fetch_changesets).never
end
View
@@ -1,5 +1,2 @@
-# Load the normal Rails helper
-require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper')
-
-# Ensure that we are using the temporary fixture path
-Engines::Testing.set_fixture_path
+# Load the normal Rails helper from the Redmine host app
+require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')

0 comments on commit 15dafeb

Please sign in to comment.