Commit 4e2c34d81b46b97929ca1db3fe1c2a1f77b03552
1 parent
7bcd112a
Exists in
spb-stable
and in
3 other branches
Test hook properly
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
features/steps/project/project_hooks.rb
1 | +require 'webmock' | |
2 | + | |
1 | 3 | class ProjectHooks < Spinach::FeatureSteps |
2 | 4 | include SharedAuthentication |
3 | 5 | include SharedProject |
4 | 6 | include SharedPaths |
5 | 7 | include RSpec::Matchers |
6 | 8 | include RSpec::Mocks::ExampleMethods |
9 | + include WebMock::API | |
7 | 10 | |
8 | 11 | Given 'project has hook' do |
9 | 12 | @hook = create(:project_hook, project: current_project) |
... | ... | @@ -25,8 +28,7 @@ class ProjectHooks < Spinach::FeatureSteps |
25 | 28 | end |
26 | 29 | |
27 | 30 | When 'I click test hook button' do |
28 | - test_hook_context = double(execute: true) | |
29 | - TestHookContext.should_receive(:new).and_return(test_hook_context) | |
31 | + stub_request(:post, @hook.url).to_return(status: 200) | |
30 | 32 | click_link 'Test Hook' |
31 | 33 | end |
32 | 34 | ... | ... |