Add additional scope check to Todo#for_target spec

This works around a condition where the Issue and the MergeRequest
created by FactoryBoth both had the same ID, which caused `for_target`
to return two records when we only expected one.
This commit is contained in:
Robert Speicher 2018-11-30 13:47:08 -06:00
parent c8fa8da2e8
commit 51e63a795e
No known key found for this signature in database
GPG key ID: 1D812769A7706642

View file

@ -236,7 +236,8 @@ describe Todo do
create(:todo, target: create(:merge_request)) create(:todo, target: create(:merge_request))
expect(described_class.for_target(todo.target)).to eq([todo]) expect(described_class.for_type(Issue.name).for_target(todo.target))
.to contain_exactly(todo)
end end
end end