summaryrefslogtreecommitdiff
path: root/spec/models/project_services/chat_message/issue_message_spec.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-11-06 13:48:34 +0000
committerSean McGivern <sean@gitlab.com>2017-11-06 14:40:13 +0000
commit5e7d68ef798c110204351ec089acd896271c4315 (patch)
tree600b43cafb3cb4ef3a5fa7768230d4c26f912240 /spec/models/project_services/chat_message/issue_message_spec.rb
parentcfc932cad10b1d6c494222e9d91aa75583b56145 (diff)
downloadgitlab-ce-5e7d68ef798c110204351ec089acd896271c4315.tar.gz
When an issue is reopened, the action is 'reopen', but the state is 'opened' (as we don't have a separate 'reopened' state any more). Because we checked the action in one method and the state in another, this lead to a weird case where the mesage neither linked to the issue, nor contained an attachment with its details. Just checking the action is fine, as it's the most granular.
Diffstat (limited to 'spec/models/project_services/chat_message/issue_message_spec.rb')
-rw-r--r--spec/models/project_services/chat_message/issue_message_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/project_services/chat_message/issue_message_spec.rb b/spec/models/project_services/chat_message/issue_message_spec.rb
index d37726dc3f1..f7a35fdc88a 100644
--- a/spec/models/project_services/chat_message/issue_message_spec.rb
+++ b/spec/models/project_services/chat_message/issue_message_spec.rb
@@ -66,6 +66,19 @@ describe ChatMessage::IssueMessage do
expect(subject.attachments).to be_empty
end
end
+
+ context 'reopen' do
+ before do
+ args[:object_attributes][:action] = 'reopen'
+ args[:object_attributes][:state] = 'opened'
+ end
+
+ it 'returns a message regarding reopening of issues' do
+ expect(subject.pretext)
+ .to eq('[<http://somewhere.com|project_name>] Issue <http://url.com|#100 Issue title> opened by Test User (test.user)')
+ expect(subject.attachments).to be_empty
+ end
+ end
end
context 'with markdown' do