debian-mirror-gitlab/spec/finders/users_with_pending_todos_finder_spec.rb
2020-06-23 00:09:42 +05:30

20 lines
450 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe UsersWithPendingTodosFinder do
describe '#execute' do
it 'returns the users for all pending todos of a target' do
issue = create(:issue)
note = create(:note)
todo = create(:todo, :pending, target: issue)
create(:todo, :pending, target: note)
users = described_class.new(issue).execute
expect(users).to eq([todo.user])
end
end
end