diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-10-25 08:33:49 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-10-25 08:33:49 +0300 |
commit | fed3f718d8e2223305fb1c0ab4e72d514f50a8f6 (patch) | |
tree | 3a0dfb5acb0d34c0ddb53ecb3fd96b076e4ac479 /spec/services/issues | |
parent | 132e3f547194de1923db258d4022b7f473f176e0 (diff) |
Fix `User#to_reference`
1. Changes in 8.13 require `Referable`s that don't have a project
reference to accept two arguments - `from_project` and
`target_project`.
2. `User#to_reference` was not changed to accept the
`target_project` (even though it is not used). Moving an issue
containing a user reference would throw a "invalid number of
arguments" exception.
Fixes #23662
Diffstat (limited to 'spec/services/issues')
-rw-r--r-- | spec/services/issues/move_service_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/services/issues/move_service_spec.rb b/spec/services/issues/move_service_spec.rb index 93bf0f64963..34ec13c43c6 100644 --- a/spec/services/issues/move_service_spec.rb +++ b/spec/services/issues/move_service_spec.rb @@ -207,10 +207,10 @@ describe Issues::MoveService, services: true do end end - describe 'rewritting references' do + describe 'rewriting references' do include_context 'issue move executed' - context 'issue reference' do + context 'issue references' do let(:another_issue) { create(:issue, project: old_project) } let(:description) { "Some description #{another_issue.to_reference}" } @@ -219,6 +219,16 @@ describe Issues::MoveService, services: true do .to eq "Some description #{old_project.to_reference}#{another_issue.to_reference}" end end + + context "user references" do + let(:another_issue) { create(:issue, project: old_project) } + let(:description) { "Some description #{user.to_reference}" } + + it "doesn't throw any errors for issues containing user references" do + expect(new_issue.description) + .to eq "Some description #{user.to_reference}" + end + end end context 'moving to same project' do |