summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorJason Goodman <jgoodman@gitlab.com>2019-05-02 16:07:26 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-05-02 16:07:26 +0000
commit1b8646804d323d1a919c0150511168f8b6ef41d1 (patch)
treee566308e3b8dc3b19b62c1be2c239ee00d3e04af /spec/models
parentf1526ccd5859f29bf054202a53a371e25c1dcb10 (diff)
downloadgitlab-ce-1b8646804d323d1a919c0150511168f8b6ef41d1.tar.gz
Update deployment chat message notification
Include link to user and commit title. Rearrange text
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_services/chat_message/deployment_message_spec.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/models/project_services/chat_message/deployment_message_spec.rb b/spec/models/project_services/chat_message/deployment_message_spec.rb
index 86565ce8b01..42c1689db3d 100644
--- a/spec/models/project_services/chat_message/deployment_message_spec.rb
+++ b/spec/models/project_services/chat_message/deployment_message_spec.rb
@@ -89,8 +89,10 @@ describe ChatMessage::DeploymentMessage do
name: "Jane Person",
username: "jane"
},
+ user_url: "user_url",
short_sha: "12345678",
- commit_url: "commit_url"
+ commit_url: "commit_url",
+ commit_title: "commit title text"
}.merge(params)
end
@@ -104,12 +106,13 @@ describe ChatMessage::DeploymentMessage do
deployment = create(:deployment, :success, deployable: ci_build, environment: environment, project: project, user: user, sha: commit.sha)
job_url = Gitlab::Routing.url_helpers.project_job_url(project, ci_build)
commit_url = Gitlab::UrlBuilder.build(deployment.commit)
+ user_url = Gitlab::Routing.url_helpers.user_url(user)
data = Gitlab::DataBuilder::Deployment.build(deployment)
message = described_class.new(data)
expect(message.attachments).to eq([{
- text: "[myspace/myproject](#{project.web_url})\n[Job ##{ci_build.id}](#{job_url}), SHA [#{deployment.short_sha}](#{commit_url}), by John Smith (smith)",
+ text: "[myspace/myproject](#{project.web_url}) with job [##{ci_build.id}](#{job_url}) by [John Smith (smith)](#{user_url})\n[#{deployment.short_sha}](#{commit_url}): #{commit.title}",
color: "good"
}])
end
@@ -120,7 +123,7 @@ describe ChatMessage::DeploymentMessage do
message = described_class.new(data)
expect(message.attachments).to eq([{
- text: "[project_path_with_namespace](project_web_url)\n[Job #3](deployable_url), SHA [12345678](commit_url), by Jane Person (jane)",
+ text: "[project_path_with_namespace](project_web_url) with job [#3](deployable_url) by [Jane Person (jane)](user_url)\n[12345678](commit_url): commit title text",
color: "danger"
}])
end
@@ -131,7 +134,7 @@ describe ChatMessage::DeploymentMessage do
message = described_class.new(data)
expect(message.attachments).to eq([{
- text: "[project_path_with_namespace](project_web_url)\n[Job #3](deployable_url), SHA [12345678](commit_url), by Jane Person (jane)",
+ text: "[project_path_with_namespace](project_web_url) with job [#3](deployable_url) by [Jane Person (jane)](user_url)\n[12345678](commit_url): commit title text",
color: "warning"
}])
end
@@ -142,7 +145,7 @@ describe ChatMessage::DeploymentMessage do
message = described_class.new(data)
expect(message.attachments).to eq([{
- text: "[project_path_with_namespace](project_web_url)\n[Job #3](deployable_url), SHA [12345678](commit_url), by Jane Person (jane)",
+ text: "[project_path_with_namespace](project_web_url) with job [#3](deployable_url) by [Jane Person (jane)](user_url)\n[12345678](commit_url): commit title text",
color: "#334455"
}])
end