mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 21:26:07 +10:00
Fix slack service speck.
This commit is contained in:
@@ -26,9 +26,7 @@ describe SlackService do
|
||||
subject.active = true
|
||||
end
|
||||
|
||||
it { should validate_presence_of :room }
|
||||
it { should validate_presence_of :subdomain }
|
||||
it { should validate_presence_of :token }
|
||||
it { should validate_presence_of :webhook }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,20 +35,17 @@ describe SlackService do
|
||||
let(:user) { create(:user) }
|
||||
let(:project) { create(:project) }
|
||||
let(:sample_data) { GitPushService.new.sample_data(project, user) }
|
||||
let(:subdomain) { 'gitlab' }
|
||||
let(:token) { 'verySecret' }
|
||||
let(:webhook) { 'https://gitlabhq.slack.com/services/hooks?token=cdIj4r4LfXUOySDUjp0tk3OI' }
|
||||
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
|
||||
slack.stub(
|
||||
project: project,
|
||||
project_id: project.id,
|
||||
room: '#gitlab',
|
||||
service_hook: true,
|
||||
subdomain: subdomain,
|
||||
token: token
|
||||
webhook: webhook
|
||||
)
|
||||
|
||||
WebMock.stub_request(:post, api_url)
|
||||
|
||||
Reference in New Issue
Block a user