summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-07-18 14:00:39 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-07-18 14:00:39 +0800
commit6830e2821f16d832963320aae571612f50a8aaa0 (patch)
tree5ba99d21f5d371e0200154e7c0480911e2e5d3e3 /spec
parent6de48227badd879f7e12803592daa2fc73656f91 (diff)
downloadgitlab-ce-6830e2821f16d832963320aae571612f50a8aaa0.tar.gz
Match against records rather than id, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13125605 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_13125611
Diffstat (limited to 'spec')
-rw-r--r--spec/models/build_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb
index b2dcbd8da2e..a57f0b6886c 100644
--- a/spec/models/build_spec.rb
+++ b/spec/models/build_spec.rb
@@ -698,9 +698,9 @@ describe Ci::Build, models: true do
end
it 'returns builds from ref' do
- build_ids = project.latest_success_builds_for('HEAD').map(&:id)
+ builds = project.latest_success_builds_for('HEAD')
- expect(build_ids).to eq([build.id])
+ expect(builds).to contain_exactly(build)
end
it 'returns empty relation if the build cannot be found' do