diff options
author | Toon Claes <toon@gitlab.com> | 2017-06-20 21:32:49 +0200 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-06-20 21:32:49 +0200 |
commit | 451e25532ff43de8151b71ced8246f709c08bf92 (patch) | |
tree | d317d555f78b4314d6a3f3989ac56c40017a131d /spec/models | |
parent | fcd46c1af4ceeec7813a91111dfce5e492695119 (diff) | |
download | gitlab-ce-451e25532ff43de8151b71ced8246f709c08bf92.tar.gz |
Make MergeRequest respond to assignee_ids & assignee_ids=
To make it simpler to assign users to an Issuable, make MergeRequest
support the attribute `assignee_ids`.
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/merge_request_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index a56bc524a98..945189b922b 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -105,6 +105,22 @@ describe MergeRequest, models: true do end end + describe '#assignee_ids' do + it 'returns an array of the assigned user id' do + subject.assignee_id = 123 + + expect(subject.assignee_ids).to eq([123]) + end + end + + describe '#assignee_ids=' do + it 'sets assignee_id to the last id in the array' do + subject.assignee_ids = [123, 456] + + expect(subject.assignee_id).to eq(456) + end + end + describe '#assignee_or_author?' do let(:user) { create(:user) } |