diff options
author | Robert Speicher <rspeicher@gmail.com> | 2019-08-13 22:59:12 +0000 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2019-08-13 22:59:12 +0000 |
commit | 25cee3e06665ad9046bb828a38a76d2e4756a965 (patch) | |
tree | e24048142663f1baf741d234e4ffcce320bf9196 | |
parent | 0abe539392e7f918732c616b9fa60d137a1cb40f (diff) | |
parent | 5112d92c9bbd2c5ba270e033b5eb0252f574a814 (diff) | |
download | gitlab-ce-25cee3e06665ad9046bb828a38a76d2e4756a965.tar.gz |
Merge branch '66008-fix-project-image-in-slack-notifications' into 'master'
Fix project avatar image in Slack pipeline notifications
Closes #66008
See merge request gitlab-org/gitlab-ce!31788
3 files changed, 9 insertions, 4 deletions
diff --git a/app/models/project_services/chat_message/pipeline_message.rb b/app/models/project_services/chat_message/pipeline_message.rb index 4edf263433f..a3793d9937b 100644 --- a/app/models/project_services/chat_message/pipeline_message.rb +++ b/app/models/project_services/chat_message/pipeline_message.rb @@ -68,7 +68,7 @@ module ChatMessage title_link: pipeline_url, fields: attachments_fields, footer: project.name, - footer_icon: project.avatar_url, + footer_icon: project.avatar_url(only_path: false), ts: finished_at }] end diff --git a/changelogs/unreleased/66008-fix-project-image-in-slack-notifications.yml b/changelogs/unreleased/66008-fix-project-image-in-slack-notifications.yml new file mode 100644 index 00000000000..df0ac649ac1 --- /dev/null +++ b/changelogs/unreleased/66008-fix-project-image-in-slack-notifications.yml @@ -0,0 +1,5 @@ +--- +title: Fix project avatar image in Slack pipeline notifications +merge_request: 31788 +author: +type: fixed diff --git a/spec/models/project_services/chat_message/pipeline_message_spec.rb b/spec/models/project_services/chat_message/pipeline_message_spec.rb index 619ab96af94..cf7c7bf7e61 100644 --- a/spec/models/project_services/chat_message/pipeline_message_spec.rb +++ b/spec/models/project_services/chat_message/pipeline_message_spec.rb @@ -42,9 +42,9 @@ describe ChatMessage::PipelineMessage do before do test_commit = double("A test commit", committer: args[:user], title: "A test commit message") - test_project = double("A test project", - commit_by: test_commit, name: args[:project][:name], - web_url: args[:project][:web_url], avatar_url: args[:project][:avatar_url]) + test_project = double("A test project", commit_by: test_commit, name: args[:project][:name], web_url: args[:project][:web_url]) + allow(test_project).to receive(:avatar_url).with(no_args).and_return("/avatar") + allow(test_project).to receive(:avatar_url).with(only_path: false).and_return(args[:project][:avatar_url]) allow(Project).to receive(:find) { test_project } test_pipeline = double("A test pipeline", has_yaml_errors?: has_yaml_errors, |