summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-17 11:11:22 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-17 11:48:51 +0100
commitb9036ba61012e6723426f98171a2c111abb0bae5 (patch)
treea249a06e9e80a7db1f2ae53dc8ae99402492eef7 /spec/services
parentdda7f9635fe96eba52110979914ff966188f6e8b (diff)
downloadgitlab-ce-b9036ba61012e6723426f98171a2c111abb0bae5.tar.gz
Prevent issue move if issue has been already moved
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/issues/move_service_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/services/issues/move_service_spec.rb b/spec/services/issues/move_service_spec.rb
index cb02b8721ac..02ade91ac03 100644
--- a/spec/services/issues/move_service_spec.rb
+++ b/spec/services/issues/move_service_spec.rb
@@ -91,6 +91,11 @@ describe Issues::MoveService, services: true do
it 'creates a new internal id for issue' do
expect(new_issue.iid).to be 1
end
+
+ it 'marks issue as moved' do
+ expect(old_issue.moved?).to eq true
+ expect(old_issue.moved_to).to eq new_issue
+ end
end
context 'issue with notes' do
@@ -220,6 +225,19 @@ describe Issues::MoveService, services: true do
it { is_expected.to be_falsey }
end
+
+ context 'issue has already been moved' do
+ include_context 'user can move issue'
+
+ let(:moved_to_issue) { create(:issue) }
+
+ let(:old_issue) do
+ create(:issue, project: old_project, author: author,
+ moved_to: moved_to_issue)
+ end
+
+ it { is_expected.to be_falsey }
+ end
end
end
end