@@ -15,7 +15,7 @@ describe SlackService::BuildMessage do
commit: {
status: status,
author_name: 'hacker',
duration: 10,
duration: duration,
},
}
end
...
...
@@ -23,9 +23,10 @@ describe SlackService::BuildMessage do
context'succeeded'do
let(:status){'success'}
let(:color){'good'}
let(:duration){10}
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 second(s)'
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'
@@ -35,9 +36,23 @@ describe SlackService::BuildMessage do
context'failed'do
let(:status){'failed'}
let(:color){'danger'}
let(:duration){10}
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 second(s)'
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'