"#{project_link}: Pipeline #{pipeline_link} of #{branch_link}#{ref_type} by #{user_name}#{humanized_status} in #{duration}#{'second'.pluralize(duration)}"
@@ -10,7 +10,7 @@ describe SlackService::BuildMessage do
tag: false,
project_name: 'project_name',
project_url: 'somewhere.com',
project_url: 'example.gitlab.com',
commit: {
status: status,
...
...
@@ -20,42 +20,38 @@ describe SlackService::BuildMessage do
}
end
context'succeeded'do
let(:message){build_message}
context'build succeeded'do
let(:status){'success'}
let(:color){'good'}
let(:duration){10}
let(:message){build_message('passed')}
it'returns a message with information about succeeded build'do
message='<somewhere.com|project_name>: Commit <somewhere.com/commit/97de212e80737a608d939f648d959671fb0a0142/builds|97de212e> of <somewhere.com/commits/develop|develop> branch by hacker passed in 10 seconds'
it'returns a message with information about failed build'do
message='<somewhere.com|project_name>: Commit <somewhere.com/commit/97de212e80737a608d939f648d959671fb0a0142/builds|97de212e> of <somewhere.com/commits/develop|develop> branch by hacker failed in 10 seconds'
it'returns seconds as singular when there is only one'do
message='<somewhere.com|project_name>: Commit <somewhere.com/commit/97de212e80737a608d939f648d959671fb0a0142/builds|97de212e> of <somewhere.com/commits/develop|develop> branch by hacker failed in 1 second'