summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-09-01 10:47:32 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-09-01 10:47:32 +0000
commit10854ad8256c605343e8f56b5bf46f7e27b90524 (patch)
tree9a9f102cf746e01d1abcfbdf9f6af03c292d59af /spec/services
parentaeb005fcf82660b4e37ef37856219db6b961627e (diff)
parent7e71f958ac721f5c36c20a5366c1e46adce4c67d (diff)
downloadgitlab-ce-10854ad8256c605343e8f56b5bf46f7e27b90524.tar.gz
Merge branch 'move-action' into 'master'
Merge request to address /move functionality. See merge request !13436
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/issues/update_service_spec.rb20
-rw-r--r--spec/services/quick_actions/interpret_service_spec.rb10
2 files changed, 30 insertions, 0 deletions
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb
index 34fb16edc84..2176469aba6 100644
--- a/spec/services/issues/update_service_spec.rb
+++ b/spec/services/issues/update_service_spec.rb
@@ -510,6 +510,26 @@ describe Issues::UpdateService, :mailer do
end
end
+ context 'move issue to another project' do
+ let(:target_project) { create(:project) }
+
+ context 'valid project' do
+ before do
+ target_project.team << [user, :master]
+ end
+
+ it 'calls the move service with the proper issue and project' do
+ move_stub = class_double("Issues::MoveService").as_stubbed_const
+ allow(Issues::MoveService).to receive(:new).and_return(move_stub)
+ allow(move_stub).to receive(:execute).with(issue, target_project).and_return(issue)
+
+ expect(move_stub).to receive(:execute).with(issue, target_project)
+
+ update_issue(target_project: target_project)
+ end
+ end
+ end
+
include_examples 'issuable update service' do
let(:open_issuable) { issue }
let(:closed_issuable) { create(:closed_issue, project: project) }
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb
index 30fa0ee6873..6926ac85de3 100644
--- a/spec/services/quick_actions/interpret_service_spec.rb
+++ b/spec/services/quick_actions/interpret_service_spec.rb
@@ -1147,5 +1147,15 @@ describe QuickActions::InterpretService do
expect(explanations).to eq(["Moves issue to ~#{bug.id} column in the board."])
end
end
+
+ describe 'move issue to another project command' do
+ let(:content) { '/move test/project' }
+
+ it 'includes the project name' do
+ _, explanations = service.explain(content, issue)
+
+ expect(explanations).to eq(["Moves this issue to test/project."])
+ end
+ end
end
end