diff options
author | Robert Speicher <rspeicher@gmail.com> | 2018-11-30 13:47:08 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2018-11-30 13:47:08 -0600 |
commit | 51e63a795e04b1fddc666e6b0a71ddd76196618a (patch) | |
tree | c8159a441e0ae6ec20f82a02eb5e64d39af4903a /spec/models/todo_spec.rb | |
parent | c8fa8da2e8814f2e0c28484c3974d678eaf9e043 (diff) | |
download | gitlab-ce-51e63a795e04b1fddc666e6b0a71ddd76196618a.tar.gz |
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.
Diffstat (limited to 'spec/models/todo_spec.rb')
-rw-r--r-- | spec/models/todo_spec.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/models/todo_spec.rb b/spec/models/todo_spec.rb index 82ff2a002e0..3682e21ca40 100644 --- a/spec/models/todo_spec.rb +++ b/spec/models/todo_spec.rb @@ -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 |