diff options
author | Sean McGivern <sean@gitlab.com> | 2019-05-06 23:24:23 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-05-06 23:24:23 +0300 |
commit | 835c616b12a8712634f5ddbfd8a5e70673a1a663 (patch) | |
tree | a5ac03e27de2d0c92060bc7c6f40b9dae8c0802f /spec/models/issue_spec.rb | |
parent | 1309e180fad744658ed8de9d912fb4eaf9998be8 (diff) |
Fix editing issues and MRs with NULL lock_version
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r-- | spec/models/issue_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 0cd69cb4817..0ce4add5669 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -55,6 +55,18 @@ describe Issue do end end + describe 'locking' do + it 'works when an issue has a NULL lock_version' do + issue = create(:issue) + + described_class.where(id: issue.id).update_all('lock_version = NULL') + + issue.update!(lock_version: 0, title: 'locking test') + + expect(issue.reload.title).to eq('locking test') + end + end + describe '#order_by_position_and_priority' do let(:project) { create :project } let(:p1) { create(:label, title: 'P1', project: project, priority: 1) } |