Commit 7152a5ee authored by Kamil Trzciński's avatar Kamil Trzciński

Fix some specs failures

parent c9b0594e
......@@ -48,6 +48,10 @@ class CommitStatus < ApplicationRecord
scope :processables, -> { where(type: %w[Ci::Build Ci::Bridge]) }
scope :for_ids, -> (ids) { where(id: ids) }
scope :with_preloads, -> do
preload(:project, :taggings, :deployment, :user)
end
scope :with_needs, -> (names = nil) do
needs = Ci::BuildNeed.scoped_build.select(1)
needs = needs.where(name: names) if names
......
......@@ -94,10 +94,7 @@ module Ci
def created_processables_in_stage_without_needs(index)
created_processables_without_needs
.preload(:project)
.preload(:taggings)
.preload(:deployment)
.preload(:user)
.with_preloads
.for_stage(index)
end
......
......@@ -47,7 +47,7 @@ module Gitlab
columns << :allow_failure if !subject.respond_to?(:column_names) || subject.column_names.include?('allow_failure')
subject
.pluck(*columns)
.pluck(*columns) # rubocop: disable CodeReuse/ActiveRecord
.map { |attrs| columns.zip(attrs).to_h }
end
......
......@@ -50,6 +50,5 @@ describe Gitlab::Ci::Status::CompositeStatus do
it_behaves_like 'validate all combinations', 0
it_behaves_like 'validate all combinations', 1
it_behaves_like 'validate all combinations', 2
#it_behaves_like 'validate all combinations', 3
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment