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
1 changed files with 2 additions and 1 deletions

View File

@ -236,7 +236,8 @@ describe Todo do
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