From: Dmitriy Zaporozhets Date: Wed, 15 Jan 2014 14:38:48 +0000 (+0200) Subject: Test hook properly X-Git-Tag: v6.5.0.rc1~27^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4e2c34d81b46b97929ca1db3fe1c2a1f77b03552;p=wvm%2Fgitlab.git Test hook properly Signed-off-by: Dmitriy Zaporozhets --- diff --git a/features/steps/project/project_hooks.rb b/features/steps/project/project_hooks.rb index 36555fb8e..19ff32445 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