Fix test hook and tests
This commit is contained in:
parent
4e7df0037a
commit
bba8e59a04
7 changed files with 7 additions and 7 deletions
|
@ -24,7 +24,7 @@ class Projects::ServicesController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def test
|
||||
data = Gitlab::PushDataBuilder.build(project, current_user)
|
||||
data = Gitlab::PushDataBuilder.build_sample(project, current_user)
|
||||
@service.execute(data)
|
||||
|
||||
redirect_to :back
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class TestHookService
|
||||
def execute(hook, current_user)
|
||||
data = Gitlab::PushDataBuilder.build(hook.project, current_user)
|
||||
data = Gitlab::PushDataBuilder.build_sample(hook.project, current_user)
|
||||
hook.execute(data)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ describe AssemblaService, models: true do
|
|||
token: 'verySecret',
|
||||
subdomain: 'project_name'
|
||||
)
|
||||
@sample_data = GitPushService.new.sample_data(project, user)
|
||||
@sample_data = Gitlab::PushDataBuilder.build_sample(project, user)
|
||||
@api_url = 'https://atlas.assembla.com/spaces/project_name/github_tool?secret_key=verySecret'
|
||||
WebMock.stub_request(:post, @api_url)
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ describe FlowdockService do
|
|||
service_hook: true,
|
||||
token: 'verySecret'
|
||||
)
|
||||
@sample_data = GitPushService.new.sample_data(project, user)
|
||||
@sample_data = Gitlab::PushDataBuilder.build_sample(project, user)
|
||||
@api_url = 'https://api.flowdock.com/v1/git/verySecret'
|
||||
WebMock.stub_request(:post, @api_url)
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ describe GemnasiumService do
|
|||
token: 'verySecret',
|
||||
api_key: 'GemnasiumUserApiKey'
|
||||
)
|
||||
@sample_data = GitPushService.new.sample_data(project, user)
|
||||
@sample_data = Gitlab::PushDataBuilder.build_sample(project, user)
|
||||
end
|
||||
it "should call Gemnasium service" do
|
||||
Gemnasium::GitlabService.should_receive(:execute).with(an_instance_of(Hash)).once
|
||||
|
|
|
@ -36,7 +36,7 @@ describe PushoverService do
|
|||
let(:pushover) { PushoverService.new }
|
||||
let(:user) { create(:user) }
|
||||
let(:project) { create(:project) }
|
||||
let(:sample_data) { GitPushService.new.sample_data(project, user) }
|
||||
let(:sample_data) { Gitlab::PushDataBuilder.build_sample(project, user) }
|
||||
|
||||
let(:api_key) { 'verySecret' }
|
||||
let(:user_key) { 'verySecret' }
|
||||
|
|
|
@ -34,7 +34,7 @@ describe SlackService do
|
|||
let(:slack) { SlackService.new }
|
||||
let(:user) { create(:user) }
|
||||
let(:project) { create(:project) }
|
||||
let(:sample_data) { GitPushService.new.sample_data(project, user) }
|
||||
let(:sample_data) { Gitlab::PushDataBuilder.build_sample(project, user) }
|
||||
let(:webhook_url) { 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' }
|
||||
|
||||
before do
|
||||
|
|
Loading…
Reference in a new issue