summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-15 16:38:48 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-15 16:38:48 +0200
commit4e2c34d81b46b97929ca1db3fe1c2a1f77b03552 (patch)
tree34845f96531f01405430d6518e7ce1a5ffc90f35
parent7bcd112a297fede6ce58801ae462664a246d0442 (diff)
downloadgitlab-ce-4e2c34d81b46b97929ca1db3fe1c2a1f77b03552.tar.gz
Test hook properly
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--features/steps/project/project_hooks.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/features/steps/project/project_hooks.rb b/features/steps/project/project_hooks.rb
index 36555fb8e8c..19ff3244543 100644
--- a/features/steps/project/project_hooks.rb
+++ b/features/steps/project/project_hooks.rb
@@ -1,9 +1,12 @@
+require 'webmock'
+
class ProjectHooks < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
include RSpec::Matchers
include RSpec::Mocks::ExampleMethods
+ include WebMock::API
Given 'project has hook' do
@hook = create(:project_hook, project: current_project)
@@ -25,8 +28,7 @@ class ProjectHooks < Spinach::FeatureSteps
end
When 'I click test hook button' do
- test_hook_context = double(execute: true)
- TestHookContext.should_receive(:new).and_return(test_hook_context)
+ stub_request(:post, @hook.url).to_return(status: 200)
click_link 'Test Hook'
end