Fix slack service speck.
This commit is contained in:
parent
2017977214
commit
216fb6ee07
|
@ -26,9 +26,7 @@ describe SlackService do
|
||||||
subject.active = true
|
subject.active = true
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should validate_presence_of :room }
|
it { should validate_presence_of :webhook }
|
||||||
it { should validate_presence_of :subdomain }
|
|
||||||
it { should validate_presence_of :token }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -37,20 +35,17 @@ describe SlackService do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let(:project) { create(:project) }
|
let(:project) { create(:project) }
|
||||||
let(:sample_data) { GitPushService.new.sample_data(project, user) }
|
let(:sample_data) { GitPushService.new.sample_data(project, user) }
|
||||||
let(:subdomain) { 'gitlab' }
|
let(:webhook) { 'https://gitlabhq.slack.com/services/hooks?token=cdIj4r4LfXUOySDUjp0tk3OI' }
|
||||||
let(:token) { 'verySecret' }
|
|
||||||
let(:api_url) {
|
let(:api_url) {
|
||||||
"https://#{subdomain}.slack.com/services/hooks/incoming-webhook?token=#{token}"
|
'https://gitlabhq.slack.com/services/hooks/incoming-webhook?token=cdIj4r4LfXUOySDUjp0tk3OI'
|
||||||
}
|
}
|
||||||
|
|
||||||
before do
|
before do
|
||||||
slack.stub(
|
slack.stub(
|
||||||
project: project,
|
project: project,
|
||||||
project_id: project.id,
|
project_id: project.id,
|
||||||
room: '#gitlab',
|
|
||||||
service_hook: true,
|
service_hook: true,
|
||||||
subdomain: subdomain,
|
webhook: webhook
|
||||||
token: token
|
|
||||||
)
|
)
|
||||||
|
|
||||||
WebMock.stub_request(:post, api_url)
|
WebMock.stub_request(:post, api_url)
|
||||||
|
|
Loading…
Reference in New Issue