diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/models/todo_spec.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/models/todo_spec.rb')
-rw-r--r-- | spec/models/todo_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/todo_spec.rb b/spec/models/todo_spec.rb index caa0a886abf..651e2cf273f 100644 --- a/spec/models/todo_spec.rb +++ b/spec/models/todo_spec.rb @@ -376,6 +376,18 @@ RSpec.describe Todo do end end + describe '.for_note' do + it 'returns todos that belongs to notes' do + note_1 = create(:note, noteable: issue, project: issue.project) + note_2 = create(:note, noteable: issue, project: issue.project) + todo_1 = create(:todo, note: note_1) + todo_2 = create(:todo, note: note_2) + create(:todo, note: create(:note)) + + expect(described_class.for_note([note_1, note_2])).to contain_exactly(todo_1, todo_2) + end + end + describe '.group_by_user_id_and_state' do let_it_be(:user1) { create(:user) } let_it_be(:user2) { create(:user) } |