diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /spec/models/project_services/chat_message | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'spec/models/project_services/chat_message')
-rw-r--r-- | spec/models/project_services/chat_message/alert_message_spec.rb | 1 | ||||
-rw-r--r-- | spec/models/project_services/chat_message/merge_message_spec.rb | 26 |
2 files changed, 14 insertions, 13 deletions
diff --git a/spec/models/project_services/chat_message/alert_message_spec.rb b/spec/models/project_services/chat_message/alert_message_spec.rb index 927c5dffe77..4d400990789 100644 --- a/spec/models/project_services/chat_message/alert_message_spec.rb +++ b/spec/models/project_services/chat_message/alert_message_spec.rb @@ -6,6 +6,7 @@ RSpec.describe ChatMessage::AlertMessage do subject { described_class.new(args) } let_it_be(:start_time) { Time.current } + let(:alert) { create(:alert_management_alert, started_at: start_time) } let(:args) do diff --git a/spec/models/project_services/chat_message/merge_message_spec.rb b/spec/models/project_services/chat_message/merge_message_spec.rb index 02b266e4fae..71cfe3ff45b 100644 --- a/spec/models/project_services/chat_message/merge_message_spec.rb +++ b/spec/models/project_services/chat_message/merge_message_spec.rb @@ -16,7 +16,7 @@ RSpec.describe ChatMessage::MergeMessage do project_url: 'http://somewhere.com', object_attributes: { - title: "Merge Request title\nSecond line", + title: "Merge request title\nSecond line", id: 10, iid: 100, assignee_id: 1, @@ -35,7 +35,7 @@ RSpec.describe ChatMessage::MergeMessage do context 'open' do it 'returns a message regarding opening of merge requests' do expect(subject.pretext).to eq( - 'Test User (test.user) opened merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> in <http://somewhere.com|project_name>') + 'Test User (test.user) opened merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge request title*> in <http://somewhere.com|project_name>') expect(subject.attachments).to be_empty end end @@ -46,7 +46,7 @@ RSpec.describe ChatMessage::MergeMessage do end it 'returns a message regarding closing of merge requests' do expect(subject.pretext).to eq( - 'Test User (test.user) closed merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> in <http://somewhere.com|project_name>') + 'Test User (test.user) closed merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge request title*> in <http://somewhere.com|project_name>') expect(subject.attachments).to be_empty end end @@ -60,12 +60,12 @@ RSpec.describe ChatMessage::MergeMessage do context 'open' do it 'returns a message regarding opening of merge requests' do expect(subject.pretext).to eq( - 'Test User (test.user) opened merge request [!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100) in [project_name](http://somewhere.com)') + 'Test User (test.user) opened merge request [!100 *Merge request title*](http://somewhere.com/-/merge_requests/100) in [project_name](http://somewhere.com)') expect(subject.attachments).to be_empty expect(subject.activity).to eq({ - title: 'Merge Request opened by Test User (test.user)', + title: 'Merge request opened by Test User (test.user)', subtitle: 'in [project_name](http://somewhere.com)', - text: '[!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100)', + text: '[!100 *Merge request title*](http://somewhere.com/-/merge_requests/100)', image: 'http://someavatar.com' }) end @@ -78,12 +78,12 @@ RSpec.describe ChatMessage::MergeMessage do it 'returns a message regarding closing of merge requests' do expect(subject.pretext).to eq( - 'Test User (test.user) closed merge request [!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100) in [project_name](http://somewhere.com)') + 'Test User (test.user) closed merge request [!100 *Merge request title*](http://somewhere.com/-/merge_requests/100) in [project_name](http://somewhere.com)') expect(subject.attachments).to be_empty expect(subject.activity).to eq({ - title: 'Merge Request closed by Test User (test.user)', + title: 'Merge request closed by Test User (test.user)', subtitle: 'in [project_name](http://somewhere.com)', - text: '[!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100)', + text: '[!100 *Merge request title*](http://somewhere.com/-/merge_requests/100)', image: 'http://someavatar.com' }) end @@ -97,7 +97,7 @@ RSpec.describe ChatMessage::MergeMessage do it 'returns a message regarding completed approval of merge requests' do expect(subject.pretext).to eq( - 'Test User (test.user) approved merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> '\ + 'Test User (test.user) approved merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge request title*> '\ 'in <http://somewhere.com|project_name>') expect(subject.attachments).to be_empty end @@ -110,7 +110,7 @@ RSpec.describe ChatMessage::MergeMessage do it 'returns a message regarding revocation of completed approval of merge requests' do expect(subject.pretext).to eq( - 'Test User (test.user) unapproved merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> '\ + 'Test User (test.user) unapproved merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge request title*> '\ 'in <http://somewhere.com|project_name>') expect(subject.attachments).to be_empty end @@ -123,7 +123,7 @@ RSpec.describe ChatMessage::MergeMessage do it 'returns a message regarding added approval of merge requests' do expect(subject.pretext).to eq( - 'Test User (test.user) added their approval to merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> '\ + 'Test User (test.user) added their approval to merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge request title*> '\ 'in <http://somewhere.com|project_name>') expect(subject.attachments).to be_empty end @@ -136,7 +136,7 @@ RSpec.describe ChatMessage::MergeMessage do it 'returns a message regarding revoking approval of merge requests' do expect(subject.pretext).to eq( - 'Test User (test.user) removed their approval from merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> '\ + 'Test User (test.user) removed their approval from merge request <http://somewhere.com/-/merge_requests/100|!100 *Merge request title*> '\ 'in <http://somewhere.com|project_name>') expect(subject.attachments).to be_empty end |