Commit 13cee6d7 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix test failures

parent 10499677
......@@ -8,7 +8,7 @@ module Ci
delegate :project, to: :pipeline
def initialize(pipeline, name: name, status: nil)
def initialize(pipeline, name:, status: nil)
@pipeline, @name, @status = pipeline, name, status
end
......@@ -25,11 +25,11 @@ module Ci
end
def statuses
@statuses ||= pipeline.statuses.where(stage: stage)
@statuses ||= pipeline.statuses.where(stage: name)
end
def builds
@builds ||= pipeline.builds.where(stage: stage)
@builds ||= pipeline.builds.where(stage: name)
end
end
end
......@@ -10,8 +10,8 @@ module Gitlab
def details_path
namespace_project_pipeline_path(@subject.project.namespace,
@subject.project,
@subject,
anchor: subject.name)
@subject.pipeline,
anchor: @subject.name)
end
def has_action?
......
......@@ -2,11 +2,11 @@ require 'spec_helper'
describe Gitlab::Ci::Status::Stage::Common do
let(:pipeline) { create(:ci_pipeline) }
let(:stage) { Ci::Stage.new(pipeline, 'test') }
let(:stage) { Ci::Stage.new(pipeline, name: 'test') }
subject do
Class.new(Gitlab::Ci::Status::Core)
.new(pipeline).extend(described_class)
.new(stage).extend(described_class)
end
it 'does not have action' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe Gitlab::Ci::Status::Stage::Factory do
let(:pipeline) { create(:ci_pipeline) }
let(:stage) { Ci::Stage.new(pipeline, 'test') }
let(:stage) { Ci::Stage.new(pipeline, name: 'test') }
subject do
described_class.new(stage)
......@@ -15,7 +15,9 @@ describe Gitlab::Ci::Status::Stage::Factory do
context 'when stage has a core status' do
HasStatus::AVAILABLE_STATUSES.each do |core_status|
context "when core status is #{core_status}" do
let(:build) { create(:ci_build, pipeline: pipeline, stage: stage.name, status: core_status) }
let!(:build) do
create(:ci_build, pipeline: pipeline, stage: 'test', status: core_status)
end
it "fabricates a core status #{core_status}" do
expect(status).to be_a(
......
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