Test hook properly

Signed-off-by: NDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
上级 7bcd112a
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册