Commit f4450d9b authored by Vitali Tatarintev's avatar Vitali Tatarintev

Use IID instead of issue ID to update title

parent 1487a9f8
...@@ -135,7 +135,7 @@ module EE ...@@ -135,7 +135,7 @@ module EE
private private
def update_generic_alert_title_if_applicable def update_generic_alert_title_if_applicable
update_column(:title, "#{title} #{id}") if generic_alert_with_default_title? update_attributes(title: "#{title} #{iid}") if generic_alert_with_default_title?
end end
def generic_alert_with_default_title? def generic_alert_with_default_title?
......
...@@ -13,7 +13,7 @@ describe Issue do ...@@ -13,7 +13,7 @@ describe Issue do
let(:author) { User.alert_bot } let(:author) { User.alert_bot }
context 'when issue title is "New: Incident"' do context 'when issue title is "New: Incident"' do
let(:issue) { build(:issue, project: project, author: author, title: 'New: Incident') } let(:issue) { build(:issue, project: project, author: author, title: 'New: Incident', iid: 503503) }
context 'when alerts service is active' do context 'when alerts service is active' do
before do before do
...@@ -24,7 +24,7 @@ describe Issue do ...@@ -24,7 +24,7 @@ describe Issue do
it 'updates issue title with the IID' do it 'updates issue title with the IID' do
issue.save issue.save
expect(issue.reload.title).to eq("New: Incident #{issue.id}") expect(issue.reload.title).to eq("New: Incident 503503")
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment