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,19 +91,20 @@ describe GitPushService do
91 end 91 end
92 end 92 end
93 93
94 - context "does not execute web hooks" do 94 + context "execute web hooks" do
95 before do 95 before do
96 @project_hook = create(:project_hook) 96 @project_hook = create(:project_hook)
97 project.hooks << [@project_hook] 97 project.hooks << [@project_hook]
  98 + stub_request(:post, @project_hook.url)
98 end 99 end
99 100
100 it "when pushing a branch for the first time" do 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 service.execute(project, user, @blankrev, 'newrev', 'refs/heads/master') 103 service.execute(project, user, @blankrev, 'newrev', 'refs/heads/master')
103 end 104 end
104 105
105 it "when pushing tags" do 106 it "when pushing tags" do
106 - @project_hook.should_not_receive(:execute) 107 + @project_hook.should_not_receive(:async_execute)
107 service.execute(project, user, 'newrev', 'newrev', 'refs/tags/v1.0.0') 108 service.execute(project, user, 'newrev', 'newrev', 'refs/tags/v1.0.0')
108 end 109 end
109 end 110 end