Commit 777456b29ccf69774048061bb0aac91e4406fef8

Authored by Dmitriy Zaporozhets
1 parent 6b16f8a7

fix tests

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
spec/services/git_push_service_spec.rb
... ... @@ -91,19 +91,20 @@ describe GitPushService do
91 91 end
92 92 end
93 93  
94   - context "does not execute web hooks" do
  94 + context "execute web hooks" do
95 95 before do
96 96 @project_hook = create(:project_hook)
97 97 project.hooks << [@project_hook]
  98 + stub_request(:post, @project_hook.url)
98 99 end
99 100  
100 101 it "when pushing a branch for the first time" do
101   - @project_hook.should_not_receive(:execute)
  102 + @project_hook.should_receive(:async_execute)
102 103 service.execute(project, user, @blankrev, 'newrev', 'refs/heads/master')
103 104 end
104 105  
105 106 it "when pushing tags" do
106   - @project_hook.should_not_receive(:execute)
  107 + @project_hook.should_not_receive(:async_execute)
107 108 service.execute(project, user, 'newrev', 'newrev', 'refs/tags/v1.0.0')
108 109 end
109 110 end
... ...