Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/integrations/chat_message/pipeline_message_spec.rb')
-rw-r--r--spec/models/integrations/chat_message/pipeline_message_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/models/integrations/chat_message/pipeline_message_spec.rb b/spec/models/integrations/chat_message/pipeline_message_spec.rb
index 4d371ca0899..5eb3915018e 100644
--- a/spec/models/integrations/chat_message/pipeline_message_spec.rb
+++ b/spec/models/integrations/chat_message/pipeline_message_spec.rb
@@ -388,4 +388,31 @@ RSpec.describe Integrations::ChatMessage::PipelineMessage do
)
end
end
+
+ describe '#attachment_color' do
+ context 'when success' do
+ before do
+ args[:object_attributes][:status] = 'success'
+ end
+
+ it { expect(subject.attachment_color).to eq('good') }
+ end
+
+ context 'when passed with warnings' do
+ before do
+ args[:object_attributes][:status] = 'success'
+ args[:object_attributes][:detailed_status] = 'passed with warnings'
+ end
+
+ it { expect(subject.attachment_color).to eq('warning') }
+ end
+
+ context 'when failed' do
+ before do
+ args[:object_attributes][:status] = 'failed'
+ end
+
+ it { expect(subject.attachment_color).to eq('danger') }
+ end
+ end
end