2018-09-20 11:05:26 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe UsersWithPendingTodosFinder do
|
2018-09-20 11:05:26 -04:00
|
|
|
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
|