Commit 1ebdf6a3 authored by Felipe Artur's avatar Felipe Artur

Rename issuables_assigned_message method

parent af9c91fe
...@@ -17,7 +17,7 @@ module IssuableLinks ...@@ -17,7 +17,7 @@ module IssuableLinks
# otherwise create issue links for the issues which # otherwise create issue links for the issues which
# are still not assigned and return success message. # are still not assigned and return success message.
if render_conflict_error? if render_conflict_error?
return error(issuables_assigned_message, 409) return error(issuables_already_assigned_message, 409)
end end
if render_not_found_error? if render_not_found_error?
...@@ -110,7 +110,7 @@ module IssuableLinks ...@@ -110,7 +110,7 @@ module IssuableLinks
{} {}
end end
def issuables_assigned_message def issuables_already_assigned_message
_('%{issuable}(s) already assigned' % { issuable: target_issuable_type.capitalize }) _('%{issuable}(s) already assigned' % { issuable: target_issuable_type.capitalize })
end end
......
...@@ -87,12 +87,8 @@ module EpicLinks ...@@ -87,12 +87,8 @@ module EpicLinks
@descendants ||= issuable.group.self_and_descendants @descendants ||= issuable.group.self_and_descendants
end end
def issuables_assigned_message def target_issuable_type
'Epic(s) already assigned' :epic
end
def issuables_not_found_message
'No Epic found for given params'
end end
end end
end end
...@@ -10,7 +10,7 @@ RSpec.describe EpicLinks::CreateService do ...@@ -10,7 +10,7 @@ RSpec.describe EpicLinks::CreateService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:epic) { create(:epic, group: group) } let(:epic) { create(:epic, group: group) }
let(:epic_to_add) { create(:epic, group: group) } let(:epic_to_add) { create(:epic, group: group) }
let(:expected_error) { 'No Epic found for given params' } let(:expected_error) { 'No matching epic found. Make sure that you are adding a valid epic URL.' }
let(:expected_code) { 404 } let(:expected_code) { 404 }
let(:valid_reference) { epic_to_add.to_reference(full: true) } let(:valid_reference) { epic_to_add.to_reference(full: true) }
......
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