From 6830e2821f16d832963320aae571612f50a8aaa0 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin <godfat@godfat.org> Date: Mon, 18 Jul 2016 14:00:39 +0800 Subject: [PATCH] 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 --- spec/models/build_spec.rb | 4 ++-- 1 file 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 -- GitLab