summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-15 15:01:26 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-17 07:39:16 +0100
commit1dd279d83335de71c69d0acfdcdd7eb0ebe7f3dd (patch)
tree3965a00f0ad5562da835d19ef0555ac9703c7fbf /spec/services
parent414558939339bd636a3549866ce532fa25500bc5 (diff)
downloadgitlab-ce-1dd279d83335de71c69d0acfdcdd7eb0ebe7f3dd.tar.gz
Use helper to create list of projects issue can be moved to
This also adds confirmation message if issue move has been requested.
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/issues/move_service_spec.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/services/issues/move_service_spec.rb b/spec/services/issues/move_service_spec.rb
index b71ce311afd..cb02b8721ac 100644
--- a/spec/services/issues/move_service_spec.rb
+++ b/spec/services/issues/move_service_spec.rb
@@ -28,7 +28,7 @@ describe Issues::MoveService, services: true do
new_project.team << [user, :reporter]
end
end
-
+
context 'issue movable' do
include_context 'issue move requested'
include_context 'user can move issue'
@@ -162,6 +162,18 @@ describe Issues::MoveService, services: true do
end
end
+ context 'moving to same project' do
+ let(:new_project) { old_project }
+
+ include_context 'issue move requested'
+ include_context 'user can move issue'
+
+ it 'raises error' do
+ expect { move_service }
+ .to raise_error(StandardError, /Cannot move issue/)
+ end
+ end
+
context 'issue move not requested' do
let(:new_project_id) { nil }
@@ -179,7 +191,6 @@ describe Issues::MoveService, services: true do
end
end
-
describe 'move permissions' do
include_context 'issue move requested'